Reputation: 5773
On my Python 3.6 installation, I just tried
pip install nipet
but I get this:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\me\AppData\Local\Temp\pip-install-eef9zqvc\nipet\setup.py", line 64
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('e> the current operating system is not supported.')?
This is most probably related to nipet
targeting Python 2.x.
I have successfully tried 2to3
on some part of this package, and noticed that all incompatibilities come down to print
statements. However, since it is setup.py
which fails, I cannot even install all the files in their proper location to run 2to3
on.
Is there some kind of pip
wrapper for 2to3
that would allow me to install a Python 2.x package without much manual effort?
Upvotes: 2
Views: 232
Reputation: 5773
While it is true what @Jérôme writes, this is not true for all components. For the sake of completeness, I would like to mention the use_2to3
option of setuptools
, which do most of what I wanted. (They do not touch setup.py, though, it seems).
Here is some more information:
Setuptools provides a facility to invoke 2to3 on the code as a part of the build process, by setting the keyword parameter use_2to3 to True, but the Setuptools project strongly recommends instead developing a unified codebase using six, future, or another compatibility library.
https://setuptools.readthedocs.io/en/latest/python3.html
Upvotes: 1
Reputation: 14674
TL; DR: No, you can't.
nipet is not Python 3 compatible. As @deceze said in comment, you need to fix that before trying to install it. pip can't do the job.
Checkout the code and make it Python 3 (this may involve 2to3 and probably manual changes). Then retry to install it. If you're happy with what you got, you may submit your Python 3 port to the maintainer.
Also, nipet should be fixed to specify it is Python 2 only so that it is listed as Python 2 only on PyPI and pip3 does not even attempt to install if. You should open an issue in the bugtracker to ask the maintainer to fix that. Or even send a pull-request adding appropriate classifiers to setup.py, If you're comfortable doing that.
Upvotes: 4