从OSX上可怕的pip / pip3混乱中恢复

如何解决从OSX上可怕的pip / pip3混乱中恢复

我只想安装lang软件包。 这里的问题是我花了很长时间安装了无数软件包,并且不想再做一遍。我不是python包管理的专家,我宁愿不需要成为一个。这是因为我剪切并粘贴了Stack Overflow的答案,只是天真的希望它是正确的(请参见下文)。

有没有一种方法可以简单地删除pip安装并保留已安装的软件包信息,然后使用旧的软件包信息再次重新安装pip3?

我想象pip必须将软件包信息保存在某个数据库中,所以我可能可以将其复制出来,重新安装一个新的pip,然后再复制回软件包数据?

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ pip3 install lang

    Collecting lang
      Downloading lang-1.0.5.tar.gz (5.7 kB)
        ERROR: Command errored out with exit status 1:
         command: /usr/local/opt/python@3.8/bin/python3.8 -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/setup.py'"'"'; __file__='"'"'/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/pip-egg-info
             cwd: /private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/
        Complete output (7 lines):
        Traceback (most recent call last):
          File "<string>",line 1,in <module>
          File "/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/setup.py",line 14,in <module>
            with open(path.join(here,'..','README.md'),encoding='utf-8') as f:
          File "/usr/local/Cellar/python@3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/codecs.py",line 905,in open
            file = builtins.open(filename,mode,buffering)
        FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/01/gll908b94ll0m5mzltylkp4w0000gn/T/pip-install-y291uctu/lang/../README.md'
        ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

(这很奇怪,我应该如何解决?也许pip已过期?我不记得升级命令,所以我只能从Stack Overflow中获取它。)

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ sudo -H pip3 install --upgrade pip

(完全不明显的是,它不会升级正确版本的pip,而这会破坏一切。)

    Password:
    Collecting pip
      Downloading pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
         |████████████████████████████████| 1.5 MB 1.7 MB/s 
    Installing collected packages: pip
      Attempting uninstall: pip
        Found existing installation: pip 20.0.2
        Uninstalling pip-20.0.2:
          Successfully uninstalled pip-20.0.2
    Successfully installed pip-20.2.2

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ sudo -H pip3 install --upgrade pip3

(也许应该是应该在这里升级的pip3?)

    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 584,in _build_master
        ws.require(__requires__)
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 901,in require
        needed = self.resolve(parse_requirements(requirements))
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 792,in resolve
        raise VersionConflict(dist,req).with_context(dependent_req)
    pkg_resources.VersionConflict: (pip 20.2.2 (/usr/local/lib/python3.8/site-packages),Requirement.parse('pip==20.0.2'))
    
    During handling of the above exception,another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/opt/python@3.8/bin/pip3",line 6,in <module>
        from pkg_resources import load_entry_point
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 3255,in <module>
        def _initialize_master_working_set():
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 3238,in _call_aside
        f(*args,**kwargs)
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 3267,in _initialize_master_working_set
        working_set = WorkingSet._build_master()
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 586,in _build_master
        return cls._build_from_requirements(__requires__)
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 599,in _build_from_requirements
        dists = ws.resolve(reqs,Environment())
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",line 787,in resolve
        raise DistributionNotFound(req,requirers)
    pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ pip3安装语言

    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py",requirers)
    pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ 其中点

    /usr/local/bin/pip

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ sudo pip卸载pip

(也许摆脱伪造的pip会有所帮助吗?)

    WARNING: The directory '/Users/xxx/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo,you may want sudo's -H flag.
    Found existing installation: pip 20.2.2
    Uninstalling pip-20.2.2:
      Would remove:
        /usr/local/bin/pip
        /usr/local/bin/pip3
        /usr/local/bin/pip3.8
        /usr/local/lib/python3.8/site-packages/pip-20.2.2.dist-info/*
        /usr/local/lib/python3.8/site-packages/pip/*
    Proceed (y/n)? y
      Successfully uninstalled pip-20.2.2

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ pip3

    Traceback (most recent call last):
      File "/usr/local/opt/python@3.8/bin/pip3",requirers)
    pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ 其中pip3

    /usr/local/opt/python@3.8/bin/pip3

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $

    zsh: command not found: pip

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ 其中为python3

    /usr/local/opt/python@3.8/bin/python3

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ pip3卸载pip3

    Traceback (most recent call last):
      File "/usr/local/opt/python@3.8/bin/pip3",requirers)
    pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ 查找/ -name pip 2> / dev / null

    /usr/local/lib/python3.6/site-packages/pip
    /usr/local/lib/python3.7/site-packages/pip
    /usr/local/lib/python2.7/site-packages/pip
    /usr/local/Cellar/python@2/2.7.15_3/bin/pip
    /usr/local/Cellar/python@2/2.7.15_3/libexec/pip
    /usr/local/Cellar/python@2/2.7.15_3/libexec/pip/build/lib/pip
    /usr/local/Cellar/python@2/2.7.15_3/libexec/pip/src/pip
    /usr/local/Cellar/python/3.7.6_1/libexec/pip
    /usr/local/Cellar/python/3.7.6_1/libexec/pip/src/pip
    /usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/msi/pip
    /usr/local/Cellar/python@3.8/3.8.2/libexec/bin/pip
    /usr/local/Cellar/python@3.8/3.8.2/libexec/pip
    /usr/local/Cellar/python@3.8/3.8.2/libexec/pip/build/lib/pip
    /usr/local/Cellar/python@3.8/3.8.2/libexec/pip/src/pip
    /usr/local/Cellar/python@3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/share/doc/python3.8/examples/Tools/msi/pip
    /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip
    /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip
    /Library/Python/2.7/site-packages/pip-19.2.2-py2.7.egg/pip
    /System/Volumes/Data/usr/local/lib/python3.6/site-packages/pip
    /System/Volumes/Data/usr/local/lib/python3.7/site-packages/pip
    /System/Volumes/Data/usr/local/lib/python2.7/site-packages/pip
    /System/Volumes/Data/usr/local/Cellar/python@2/2.7.15_3/bin/pip
    /System/Volumes/Data/usr/local/Cellar/python@2/2.7.15_3/libexec/pip
    /System/Volumes/Data/usr/local/Cellar/python@2/2.7.15_3/libexec/pip/build/lib/pip
    /System/Volumes/Data/usr/local/Cellar/python@2/2.7.15_3/libexec/pip/src/pip
    /System/Volumes/Data/usr/local/Cellar/python/3.7.6_1/libexec/pip
    /System/Volumes/Data/usr/local/Cellar/python/3.7.6_1/libexec/pip/src/pip
    /System/Volumes/Data/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/msi/pip
    /System/Volumes/Data/usr/local/Cellar/python@3.8/3.8.2/libexec/bin/pip
    /System/Volumes/Data/usr/local/Cellar/python@3.8/3.8.2/libexec/pip
    /System/Volumes/Data/usr/local/Cellar/python@3.8/3.8.2/libexec/pip/build/lib/pip
    /System/Volumes/Data/usr/local/Cellar/python@3.8/3.8.2/libexec/pip/src/pip
    /System/Volumes/Data/usr/local/Cellar/python@3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/share/doc/python3.8/examples/Tools/msi/pip
    /System/Volumes/Data/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip
    /System/Volumes/Data/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip
    /System/Volumes/Data/Library/Python/2.7/site-packages/pip-19.2.2-py2.7.egg/pip
    /System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip
    /Users/robotbugs/Library/Caches/pip
    /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip

〜/ Dropbox / Projects / FileSorting / ScreenShotSorter $ echo“ What the f__k \!”

(所有这些python版本是什么-我以为我在使用3.8?)

    What the f__k!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-