You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

公司电脑无root权限下Python依赖安装及pip3配置重置问题

Fix JFrog Authentication Error & Reset Pip to Local Installation

First, let's break down the root issue: your pip configuration was pre-set to use your company's private JFrog PyPI repository, which triggers an authentication prompt that's failing your dependency installs and virtualenv setup. Your error log makes this clear:

Looking in indexes: https://pypi.org/simple, https://firstname.lastname:jFrog12345@companydev.jfrog.io/companydev/api/pypi/pypi/simple

Here's a straightforward, step-by-step solution to reset pip and get your ML dependencies installed locally without touching system directories:

1. Check Current Pip Configuration

First, confirm the problematic repo settings exist:

pip3 config list

You’ll likely see entries like global.index-url or global.extra-index-url pointing to the company JFrog address.

2. Reset Pip to Default Settings

We’ll clear the user-level pip config (since you don’t have root access to modify system-wide settings):

  • Delete the user pip config file directly:
    rm ~/.config/pip/pip.conf
    
    Note: If this file doesn’t exist, check ~/.pip/pip.conf instead—location can vary slightly.
  • Alternatively, unset the problematic config entries one by one:
    pip3 config unset global.index-url
    pip3 config unset global.extra-index-url
    

3. Verify the Reset

Run pip3 config list again. You should see no repo-related entries, meaning pip will now default to the official PyPI.

4. Install Dependencies Locally with --user

Now you can install numpy, gym, and other packages directly to your user-specific site-packages directory—no system permissions needed:

pip3 install --user numpy gym

These will land in ~/.local/lib/python3.6/site-packages (matching your Python 3.6 setup), which is entirely safe and isolated from system files.

5. Fix Virtualenv Setup (If You Still Want It)

If you prefer using a virtual environment to isolate your ML project, follow these steps:

  1. First upgrade your local virtualenv to avoid the built-in download that triggers the JFrog prompt:
    pip3 install --user --upgrade virtualenv
    
  2. Create the virtual environment with the --no-download flag (this uses your local copies of setuptools/pip/wheel instead of trying to fetch them from the company repo):
    python3 -m virtualenv --no-download env
    
  3. Activate the environment:
    source env/bin/activate
    
  4. Install dependencies inside the virtual environment—pip here will use the default PyPI, no authentication required:
    pip install numpy gym
    

This should resolve all authentication errors and let you work on your ML code without system directory modifications or dealing with the company repo.

内容的提问来源于stack exchange,提问作者Leviathan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:22:32