安装了versioneer,但是pip安装仍然提供ModuleNotFoundError

时间:2019-02-06 16:24:00

标签: python pip

我已经在环境中安装了versioneer模块,运行python -m versioneer --version可以确认。然而,当我pip install cartopy时,仍然得到ModuleNotFoundError,如下所示:

(GIS3) gholl@lce00:~> python -m versioneer --version
versioneer (installer) 0.18
(GIS3) gholl@lce00:~> python -V
Python 3.7.1
(GIS3) gholl@lce00:~> which python
/hpc/uhome/gholl/miniconda3/envs/GIS3/bin/python
(GIS3) gholl@lce00:~> which pip
/hpc/uhome/gholl/miniconda3/envs/GIS3/bin/pip
(GIS3) gholl@lce00:~> pip install cartopy
Collecting cartopy
  Using cached https://files.pythonhosted.org/packages/e5/92/fe8838fa8158931906dfc4f16c5c1436b3dd2daf83592645b179581403ad/Cartopy-0.17.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  Complete output from command /hpc/uhome/gholl/miniconda3/envs/GIS3/bin/python /hpc/uhome/gholl/miniconda3/envs/GIS3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /hpc/gtmp/gholl/.jtmp.lce00.20190206.082115.24214/tmpmcze3ux9:
  Traceback (most recent call last):
    File "/hpc/uhome/gholl/miniconda3/envs/GIS3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/hpc/uhome/gholl/miniconda3/envs/GIS3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/hpc/uhome/gholl/miniconda3/envs/GIS3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/lustre1/gtmp/gholl/.jtmp.lce00.20190206.082115.24214/pip-build-env-q2k4jnrs/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 130, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/lustre1/gtmp/gholl/.jtmp.lce00.20190206.082115.24214/pip-build-env-q2k4jnrs/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 112, in _get_build_requires
      self.run_setup()
    File "/lustre1/gtmp/gholl/.jtmp.lce00.20190206.082115.24214/pip-build-env-q2k4jnrs/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 126, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 36, in <module>
      import versioneer
  ModuleNotFoundError: No module named 'versioneer'

  ----------------------------------------
Command "/hpc/uhome/gholl/miniconda3/envs/GIS3/bin/python /hpc/uhome/gholl/miniconda3/envs/GIS3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /hpc/gtmp/gholl/.jtmp.lce00.20190206.082115.24214/tmpmcze3ux9" failed with error code 1 in /lustre1/gtmp/gholl/.jtmp.lce00.20190206.082115.24214/pip-install-2q1hjb0u/cartopy

怎么可能安装了versioneer模块,但是pip install cartopy仍然找不到它?


(我知道我should probably not pip安装到了conda环境中,但是与此同时,我调试了一个完整的conda install要降级Python或结果的问题出现undefined symbolcannot open shared object file错误,因此这个问题的确有一个XY problem方面-但是,我还有其他尝试尝试我的Y)

2 个答案:

答案 0 :(得分:1)

Cartopy 0.17.0存在一个已知问题,如此处所述:Unable to install cartopy from pip on MacOSX #1270

您可以改用pip install cartopy==0.16.0,也可以尝试使用pip install --no-use-pep517 cartopy。另外,这似乎是> = 0.19的问题,因此您也可以尝试将pip降级。

答案 1 :(得分:0)

我遇到了这个错误,this 帮我解决了。

我认为需要在构建环境中安装 versioneer,我必须假设它与您安装它时是分开的。