python setup.py egg_info failed with error code 1

∥☆過路亽.° 提交于 2021-01-28 03:11:24

问题


I'm trying to install pystashop module. I have a Python 3.4 installed on Windows 7 64 bits.

When I try pip install pystashop I get this error:

Collecting pystashop
Downloading pystashop-0.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
    File "<string>", line 20, in <module>
    File "C:\Users\Me\AppData\Local\Temp\pip-build-zyt3yyca\pystashop\setup.py", line 12, in <module>
    execfile(os.path.join('pystashop', 'version.py'))
NameError: name 'execfile' is not defined

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Me\AppData\Local\Temp\pip-build-zyt3yyca\pystashop

how can I solve this?

ADD:

I tryed to install and run 'python ez_setup.py' and after run 'easy_install pip' but with no success. Still getting the same error.


回答1:


execfile is a standard library builtin in Python 2. It was removed in Python 3, which means that pystashop does not support Python 3. You should try contacting the developer(s) and request Python 3 support, and in the meantime see if you can get by with Python 2.

You can attempt to remedy the situation yourself by cloning the GitHub repo, making changes, and installing with python3 setup.py install, but there's no guarantee that it will work properly. The offending code seems to be here:

execfile(os.path.join('pystashop', 'version.py'))

You can replace this with the following:

exec(open(os.path.join('pystashop','version.py')).read())

This will provide the expected functionality. From a cursory glance over the code, everything else appears to be compatible with Python 3, though I may have missed something.



来源:https://stackoverflow.com/questions/34332453/python-setup-py-egg-info-failed-with-error-code-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!