微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

python tox; “哪个”全局站点软件包目录?

如何解决python tox; “哪个”全局站点软件包目录?

我正在尝试使用tox的sitepackages=true标志。

(我已经用下面的xxx代替了真正的内部软件包名称

我尝试从源代码手动安装一个不在pip中的软件包,该软件包出现在我的27个站点软件包中:

ls /Users/tc677g/.pyenv/versions/2.7.17/lib/python2.7/site-packages | grep xxx             
drwxr-xr-x    - root   17 Aug  8:17 xxx-1.0.0-py2.7.egg-info

此外,当我点冻结时,我会看到它:

pip freeze | grep xxx                                                                       
DEPRECATION: Python 2.7 will reach the end of its life on January 1st,2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip,can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
xxx==1.0.0

此外,我似乎可以将其导入python中:

   python                                                                                   
   >>> import xxx
   >>> 

但是,当我尝试在该项目上运行单元测试时,我得到:

tox                                                                                     461ms  Mon Aug 17 12:30:57 2020
Flake8 installed: DEPRECATION: Python 2.7 reached the end of its life on January 1st,2020. 
unittests create: /Users/tc677g/Development/resources_stash-hooks/.tox/unittests
unittests installdeps: coverage>=4.3,pytest,pytest-mock,mock,gitpython,httpretty==0.9.4,xxx
ERROR: invocation Failed (exit code 1),logfile: /Users/tc677g/Development/resources_stash-hooks/.tox/unittests/log/unittests-1.log
========================================================================= log start 
==========================================================================
DEPRECATION: Python 2.7 reached the end of its life on January 1st,2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at 
https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting coverage>=4.3
  Using cached coverage-5.2.1-cp27-cp27m-macosx_10_13_intel.whl (210 kB)
Collecting pytest
  Using cached pytest-4.6.11-py2.py3-none-any.whl (231 kB)
Collecting pytest-mock
  Using cached pytest_mock-2.0.0-py2.py3-none-any.whl (10 kB)
Collecting mock
  Using cached mock-3.0.5-py2.py3-none-any.whl (25 kB)
Collecting gitpython
  Using cached gitpython-2.1.15-py2.py3-none-any.whl (452 kB)
Collecting httpretty==0.9.4
  Using cached httpretty-0.9.4.tar.gz (2.8 MB)
ERROR: Could not find a version that satisfies the requirement xxx (from versions: none

这使我认为,启用sitepackages=true时,它将尝试从“不同的”全局软件包目录中读取。如何确认/调试/修复此问题?

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