安装pip的问题

时间:2017-07-03 15:41:51

标签: python pip install

请你能帮我安装点子吗?我以前有点,但不知怎的,我打破了它,我尝试卸载python并重新安装它,但我仍然无法得到回头...

sudo python get-pip.py
  

目录'/ Users / Name / Library / Caches / pip / http'或其父目录不属于当前用户,并且已禁用缓存。请检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo的-H标志。   目录'/ Users / Name / Library / Caches / pip'或其父目录不归当前用户所有,并且已禁用缓存轮。检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo的-H标志。   要求已经是最新的:pip in /usr/local/lib/python2.7/site-packages

sudo -H python get-pip.py
  

要求已经是最新的:pip in /usr/local/lib/python2.7/site-packages

我也试过这个:

sudo easy_install pip
  

追踪(最近一次通话):     文件“/usr/bin/easy_install-2.7”,第7行,in       从pkg_resources导入load_entry_point     文件“/Library/Python/2.7/site-packages/pkg_resources/init.py”,第2927行,       @_call_aside     在_call_aside中输入文件“/Library/Python/2.7/site-packages/pkg_resources/init.py”,第2913行       f(* args,** kwargs)     _initialize_master_working_set中的文件“/Library/Python/2.7/site-packages/pkg_resources/init.py”,第2940行       working_set = WorkingSet._build_master()     在_build_master中输入文件“/Library/Python/2.7/site-packages/pkg_resources/init.py”,第637行       return cls._build_from_requirements(需要)     在_build_from_requirements中输入文件“/Library/Python/2.7/site-packages/pkg_resources/init.py”,第650行       dists = ws.resolve(reqs,Environment())     文件“/Library/Python/2.7/site-packages/pkg_resources/init.py”,第829行,解析       提升DistributionNotFound(req,requirers)   pkg_resources.DistributionNotFound:找不到'setuptools == 1.1.6'分发,是应用程序所必需的

然后我发现pip与python一起安装,但由于某种原因,pip无效。

brew install python
  

警告:已经安装了python 2.7.13

pip install regex
  

zsh:找不到命令:pip

pip install --upgrade pip
  

zsh:找不到命令:pip

当我去这里> cd /usr/local/lib/python2.7/site-packages && ls 我找到 distribute-0.6.14-py2.7.egg pip-9.0.1.dist-info

但是当我去/usr/local/bin时,我找不到pip,只有pip3:

我确实从here尝试了一些解决方案,但它们无效。

编辑:

根据评论我试过

sudo pip install regex Password: sudo: pip: command not found ➜ ~ python -m pip install regex Collecting regex Downloading regex-2017.06.23.tar.gz (607kB) 100% |████████████████████████████████| 614kB 694kB/s Building wheels for collected packages: regex Running setup.py bdist_wheel for regex ... done Stored in directory: /Users/Manal/Library/Caches/pip/wheels/aa/48/61/f321b8a521167213da5de2a65e76530e362e58e328b1d74ab3 Successfully built regex Installing collected packages: regex Successfully installed regex-2017.6.23

我不确定它为什么有效?我怎样才能正常使用pip?

编辑:

我觉得有些东西坏了..

➜ ~ pip install regex zsh: command not found: pip ➜ ~ ➜ ~ python -m pip install regex Requirement already satisfied: regex in /usr/local/lib/python2.7/site-packages ➜ ~ which pip pip not found

我不知道为什么哪个点不返回任何东西?

编辑:

尝试安装设置工具

➜ ~ sudo brew install python-setuptools Password: Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system. ➜ ~ ➜ ~ brew install python-setuptools Error: No available formula with the name "python-setuptools" ==> Searching for a previously deleted formula... Warning: homebrew/core is shallow clone. To get complete history run: git -C "$(brew --repo homebrew/core)" fetch --unshallow Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... Error: No formulae found in taps. ➜ ~ ➜ ~ sudo apt-get install python-setuptools sudo: apt-get: command not found ➜ ~ ➜ ~ easy_install -U setuptools Traceback (most recent call last): File "/usr/bin/easy_install-2.7", line 7, in from pkg_resources import load_entry_point File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 2927, in @_call_aside File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 2913, in _call_aside f(*args, **kwargs) File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 2940, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 637, in _build_master return cls._build_from_requirements(requires) File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 650, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/Library/Python/2.7/site-packages/pkg_resources/init.py", line 829, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'setuptools==1.1.6' distribution was not found and is required by the application

0 个答案:

没有答案