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 (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...