OSError:[Errno 2]没有这样的文件或目录:' /usr/local/lib/python2.7/dist-packages/pyduino-0.0.0-py2.7.egg'

时间:2016-08-08 18:11:16

标签: python install setup.py pypi

我正在尝试安装和卸载一个软件包。我已经编写了一个setup.py脚本。虽然安装脚本工作正常并且软件包installs.But虽然卸载软件包卸载但抛出一些错误。我使用pip uninstall package_name for uninstalling.Here是追溯

Uninstalling pyduino-0.0.0:
  /usr/local/lib/python2.7/dist-packages/pyduino-0.0.0-py2.7.egg
Proceed (y/n)? y
  Successfully uninstalled pyduino-0.0.0
The directory '/home/billy/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 221, in main
    return command.main(cmd_args)
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 252, in main
    pip_version_check(session)
  File "/usr/local/lib/python2.7/dist-packages/pip/utils/outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 848, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 619, in __init__
    self.add_entry(entry)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 675, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1942, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1463, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1824, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1704, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 1644, in load
    mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/pyduino-0.0.0-py2.7.egg' 

同时包卸载。当我尝试命令pip freeze包没有显示出来。那么,为什么会出现上述错误?提前感谢帮助......

1 个答案:

答案 0 :(得分:1)

我找到了解决方案。安装后我没有升级pip。后来,我升级并完美运行..