简体   繁体   English

Setup.py尝试导入正在安装的软件包

[英]Setup.py attempts to import the package it is installing

UPDATE This is a bug in the setup.py of the package 更新这是软件包setup.py中的错误


Attempting to install certain packages using pip and I get this error: 尝试使用pip安装某些软件包,但出现此错误:

pip install saspy

command python setup.py egg_info failed with error code 1

Upon reading the traceback I see that it failed while attempting to import saspy.This is an excerpt from the setup.py which is indeed attempting to import from saspy, while installing saspy. 阅读回溯后,我发现尝试导入saspy时失败,这是setup.py的摘录,setup.py实际上是在安装saspy时尝试从saspy导入的。 How is this supposed to work? 这应该如何工作? I am using setuptools 36.0.1, pip 9.0.1 and (long story) python 2.7.8. 我正在使用setuptools 36.0.1,pip 9.0.1和(长话)python 2.7.8。

try:
  from setuptools import setup
except ImportError:
    from distutils.core import setup

from saspy import __version__

with open('README.md') as f:
    readme = f.read()

This is a buggy setup.py. 这是一个有问题的setup.py。 It's a common mistake, since with a source installation, you can import the package from the unpacked source tree before it's been installed. 这是一个常见的错误,因为使用源代码安装,您可以在安装之前从未打包的源代码树中导入软件包。

saspy requires Python3. saspy需要Python3。 I would expect this issue is due to using Python2 to try to install it. 我希望这个问题是由于使用Python2来尝试安装它。 Though I have never seen that error before when installing it. 虽然我在安装它之前从未见过该错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM