I'm trying to install BeautifulSoup package through PyCharm, I have also tried to download it through the command line. But I just cannot seem to get to it to run on PyCharm. I keep getting the following error
Collecting BeautifulSoup
Using cached BeautifulSoup-3.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Hemesh\AppData\Local\Temp\pycharm-packaging\BeautifulSoup\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Hemesh\AppData\Local\Temp\pycharm-packaging\BeautifulSoup\
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Can anyone help?
thanks in advance
Are you used to using Python 2.7? It seems to be asking for Python 3.X syntax for your print statement, so it might be an issue with the versions you're trying to use?
BeautifulSoup 3.2.1 only works with Python 2.7 (and is obsolete), if you get BeautifulSoup 4, it should work with both versions.
Related
I needed a simple hash function for passwords and thought I could use hashlib. PyCharm suggested to install it by running pip install hashLib.
But now PyCharm is complaining about a syntax error in the library:
Collecting hashLib
Using cached https://files.pythonhosted.org/packages/74/bb/9003d081345e9f0451884146e9ea2cff6e4cc4deac9ffd4a9ee98b318a49/hashlib-20081119.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/6_/8g1vyy5n1t1859x2d30ssk480000gn/T/pycharm-packaging/hashLib/setup.py", line 68
print "unknown OS, please update setup.py"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("unknown OS, please update setup.py")?
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6_/8g1vyy5n1t1859x2d30ssk480000gn/T/pycharm-packaging/hashLib/
It suggests that it may be a problem related to the Python version I am using (I tried with Python 2.7 and Python 3.8, but none of them worked).
Make sure that you use a version of Python supported by this package.
Currently you are using Python 3.8.
hashlib is in the standard library now. That means you don't need to install it, it's there already with your Python installation.
The one you tried to install from PyPI is for very old versions of Python (<= 2.4).
I was trying to install eel using pip install eel but I get an error of
C:\Users\USER>pip install eel
Collecting eel
Using cached Eel-0.7.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\user\appdata\local\temp\pip-build-aa7ptb\eel\setup.py", line 14, in <module>
long_description=open('README.md', encoding='utf-8').readlines()[1],
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\user\appdata\local\temp\pip-build-aa7ptb\eel\
I tried using pip install --upgrade setuptools but still doesnt work.
using python 2.7
The open function in Python 2.7 has a different signature and especially no keyword argument called encoding, as you can read from the error message.
Eel seems to no support Python 2.7 (you should go with Python 3 anyways ;)
open in Python 2.7: https://docs.python.org/2/library/functions.html#open
open in Python 3.6: https://docs.python.org/3/library/functions.html#open
I am trying to install IMDbPY on my MacBook running on 10.12.4 with python version 3.5.2. I did find a couple of question threads addressing the issue but the suggestions offered do not seem to help me.
Following are the outputs from my terminal.
host-vlth5x-205:IMDbPY-3.5 apple$ pip install IMDbPY
Collecting IMDbPY
Using cached IMDbPY-5.1.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/gd/f_5prpbn13j_xy22k_4nlvgh0000gn/T/pip-build-k_hgg84y/IMDbPY/setup.py", line 200
print 'Created locale for: %s.' % ' '.join(languages)
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/gd/f_5prpbn13j_xy22k_4nlvgh0000gn/T/pip-build-k_hgg84y/IMDbPY/
Post this, I have tried downloading the latest stable version of IMDbPY-3.5 here and installing the package manually via the terminal, which gave me the following error:
host-vlth5x-205:IMDbPY-3.5 apple$ python setup.py
File "setup.py", line 128
except SystemExit, e:
^
SyntaxError: invalid syntax
Please help me figure this out. Thanks!
Currently, IMDbPY is a Python 2.7-only library. It can't (yet) work on Python 3.x.
To fix your problem, install Python 2.7
I try to install local instance of Read the Docs on my Win10
When I follow this documentation:
http://docs.readthedocs.io/en/latest/install.html
and type:
pip install -r requirements.txt
I get this error:
Collecting Distutils2==1.0a3 (from -r requirements/pip.txt (line 65))
Using cached Distutils2-1.0a3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\setup.py", line 9, in <module>
from distutils2.util import find_packages
File "C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\distutils2\util.py", line 174
except KeyError, var:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\
Anyone know this error?
My pip version: 8.1.2;
python: 3.5
Is it possible you are running the Python 2 pip? The error message clearly indicates that the code is being executed under Python 3 but has Python 2 syntax. Do you get better results with
python -m pip install -r requirements.txt
I wonder? If not then verify that
python
runs version 3.5 ...
Oh. I just checked and the disutils2 page on PyPI says
Distutils2 development is stopped.
tl;dr: keep using setuptools and pip for now, don’t use distutils2.
It looks like there was never a Python 3 version. Looks like you might need to update your code.
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.
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.