Unable to Install with Pip Due to Outdated beautifulsoup - python

I'm using Anaconda with Python 3 and am trying to install the package cc, which is a requirement for the uber h3 package.
When trying to install in the anaconda command line via:
pip install cc
I'm getting an error that I'm using an outdated version of beautifulsoup on Python 3 and should use beautifulsoup4 instead. Bs4 IS installed, but it appears the requirements file coming directly to pip selects BeautifulSoup 3.2.1.
How can I override this?
Below is the error I'm getting:
Collecting cc
Using cached https://files.pythonhosted.org/packages/2f/c0/813dd3de3cda756a7ffc17b50779da0c1ea5de74c9df5e1da2856735c940/cc-0.1.tar.gz
Requirement already satisfied: requests>=2.2.1 in c:\programdata\anaconda3\lib\site-packages (from cc) (2.22.0)
Collecting BeautifulSoup>=3.2.1
Using cached https://files.pythonhosted.org/packages/40/f2/6c9f2f3e696ee6a1fb0e4d7850617e224ed2b0b1e872110abffeca2a09d4/BeautifulSoup-3.2.2.tar.gz
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\wintch3\\AppData\\Local\\Temp\\pip-install-qgjizksk\\BeautifulSoup\\setup.py'"'"'; __file__='"'"'C:\\Users\\wintch3\\AppData\\Local\\Temp\\pip-install-qgjizksk\\BeautifulSoup\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\wintch3\AppData\Local\Temp\pip-install-qgjizksk\BeautifulSoup\pip-egg-info'
cwd: C:\Users\wintch3\AppData\Local\Temp\pip-install-qgjizksk\BeautifulSoup\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\wintch3\AppData\Local\Temp\pip-install-qgjizksk\BeautifulSoup\setup.py", line 3
"You're trying to run a very old release of Beautiful Soup under Python 3. This will not work."<>"Please use Beautiful Soup 4, available through the pip package 'beautifulsoup4'."
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Thanks for all and any help!

Let's see: https://pypi.org/project/cc/#history. The only version was 0.1 released in 2016. It requires BeautifulSoup (not BeautifulSoup4).
I very much doubt it's the package that Uber requires. h3 really mentions cc but it's not a Python package — it's a C compiler! You must have gcc or any other C compiler, not that outdated cc from PyPI!

Related

Running into error with Glassdoor python package

I am trying to emulate the Glassdoor API call that is described on this GitHub repository. Below is the example that was used. Seems pretty straight forward but I am running into issues with the pip command.
pip install glassdoor
from glassdoor import get
x = get('dropbox')
x
When I run this part:
pip install glassdoor
I get the below output/error:
Collecting glassdoor
Downloading glassdoor-0.0.8.tar.gz (5.7 kB)
Requirement already satisfied: requests>=1.1.0 in c:\users\<user>\anaconda3\lib\site-packages (from glassdoor) (2.25.1)
Collecting BeautifulSoup>=3.2.1
Using cached BeautifulSoup-3.2.2.tar.gz (32 kB)
Using cached BeautifulSoup-3.2.1.tar.gz (31 kB)
Collecting glassdoor
Downloading glassdoor-0.0.4.tar.gz (5.1 kB)
Downloading glassdoor-0.0.2.tar.gz (3.8 kB)
Downloading glassdoor-0.0.1.tar.gz (3.1 kB)
The conflict is caused by:
glassdoor 0.0.8 depends on BeautifulSoup>=3.2.1
glassdoor 0.0.4 depends on BeautifulSoup>=3.2.1
glassdoor 0.0.2 depends on BeautifulSoup>=3.2.1
glassdoor 0.0.1 depends on BeautifulSoup>=3.2.1
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
Note: you may need to restart the kernel to use updated packages.
ERROR: Command errored out with exit status 1:
command: 'c:\Users\<user>\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-install-jrj24n8x\\beautifulsoup_d39f5c5ac2e34bec980b5f105aa8db54\\setup.py'"'"'; __file__='"'"'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-install-jrj24n8x\\beautifulsoup_d39f5c5ac2e34bec980b5f105aa8db54\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\<user>\AppData\Local\Temp\pip-pip-egg-info-gdpczqw5'
cwd: C:\Users\<user>\AppData\Local\Temp\pip-install-jrj24n8x\beautifulsoup_d39f5c5ac2e34bec980b5f105aa8db54\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\<user>\AppData\Local\Temp\pip-install-jrj24n8x\beautifulsoup_d39f5c5ac2e34bec980b5f105aa8db54\setup.py", line 3
"You're trying to run a very old release of Beautiful Soup under Python 3. This will not work."<>"Please use Beautiful Soup 4, available through the pip package 'beautifulsoup4'."
^
SyntaxError: invalid syntax
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/40/f2/6c9f2f3e696ee6a1fb0e4d7850617e224ed2b0b1e872110abffeca2a09d4/BeautifulSoup-3.2.2.tar.gz#sha256=a04169602bff6e3138b1259dbbf491f5a27f9499dea9a8fbafd48843f9d89970 (from https://pypi.org/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1:
command: 'c:\Users\<user>\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-install-jrj24n8x\\beautifulsoup_5e37669d18a24e84b464eb7a655a54d7\\setup.py'"'"'; __file__='"'"'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-install-jrj24n8x\\beautifulsoup_5e37669d18a24e84b464eb7a655a54d7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\<user>\AppData\Local\Temp\pip-pip-egg-info-mpb24z6z'
cwd: C:\Users\<user>\AppData\Local\Temp\pip-install-jrj24n8x\beautifulsoup_5e37669d18a24e84b464eb7a655a54d7\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\<user>\AppData\Local\Temp\pip-install-jrj24n8x\beautifulsoup_5e37669d18a24e84b464eb7a655a54d7\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have failed!")?
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz#sha256=6a8cb4401111e011b579c8c52a51cdab970041cc543814bbd9577a4529fe1cdb (from https://pypi.org/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Cannot install glassdoor==0.0.1, glassdoor==0.0.2, glassdoor==0.0.4 and glassdoor==0.0.8 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
I have tried in both CoLab and Visual Studio Code and get the same error. I have also tried uninstalling both the Glassdoor and the BeautifulSoup4 packages and reinstalling the latest versions to no avail.
Does anyone have any insight on how to fix this?

Problems with installing plotly on Windows 10 with Python 3.8.5

I am having problems installing plotly on Windows 10 with Python 3.8.5. The command line prompt is in admin mode.
The package manager pip3 here seems to be installing the package retrying-1.3.3 which is running into an error:
ModuleNotFoundError: No module named '_distutils_hack'
Anybody has a solution for this? Greatly appreciate your time. Thanks
C:\ProgramData\Python38\Scripts>pip3 install plotly
Collecting plotly
Using cached plotly-4.14.1-py2.py3-none-any.whl (13.2 MB)
Requirement already satisfied: six in c:\programdata\python38\lib\site-packages (from plotly) (1.15.0)
Collecting retrying>=1.3.3
Using cached retrying-1.3.3.tar.gz (10 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\programdata\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\student\\AppData\\Local\\Temp\\pip-install-2qndeluw\\retrying_de785ef56b9d4150b577dd9f4437e271\\setup.py'"'"'; __file__='"'"'C:\\Users\\student\\AppData\\Local\\Temp\\pip-install-2qndeluw\\retrying_de785ef56b9d4150b577dd9f4437e271\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\student\AppData\Local\Temp\pip-pip-egg-info-3tjoj6d_'
cwd: C:\Users\student\AppData\Local\Temp\pip-install-2qndeluw\retrying_de785ef56b9d4150b577dd9f4437e271\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\programdata\python38\lib\site-packages\setuptools\__init__.py", line 8, in <module>
import _distutils_hack.override # noqa: F401
ModuleNotFoundError: No module named '_distutils_hack'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The problem may be that the version of the 'setuptools' package is too old. I just updated it when I encountered this problem before.
pip install --upgrade setuptools

exit status 1 when trying to pip install cantools

Whenever I try to pip install cantools==34.0.0 (on python 2.7)
i receive the error:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support
in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting cantools==34.0.0
Using cached cantools-34.0.0-py2.py3-none-any.whl (77 kB)
Collecting diskcache
Using cached diskcache-5.0.2.tar.gz (47 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\bla\\appdata\\local\\temp\\pip-install-4or8zd\\diskcache\\setup.py'"'"'; __file__='"'"'c:\\
users\\bla\\appdata\\local\\temp\\pip-install-4or8zd\\diskcache\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"
'"'))' egg_info --egg-base 'c:\users\bla\appdata\local\temp\pip-pip-egg-info-mxhtc0'
cwd: c:\users\bla\appdata\local\temp\pip-install-4or8zd\diskcache\
Complete output (10 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\bla\appdata\local\temp\pip-install-4or8zd\diskcache\setup.py", line 5, in <module>
import diskcache
File "diskcache\__init__.py", line 9, in <module>
from .core import (
File "diskcache\core.py", line 434
raise ValueError('disk must subclass diskcache.Disk') from None
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can anyone please help me? It seems like it happens when it tries to install the package diskcache
I fixed it, the problem was with installing the diskcache module,
By default it tried to install a python 3 version supported version
when I manually installed it pip install diskcache==4.1.0
and then installed cantools again it worked.

Issue installing bpy package python

I'm trying to install the bpy package and I’m getting this error:
sara#studentacbook94 ~ % pip install bpy
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting bpy
Using cached bpy-1.2.2.tar.gz (20 kB)
ERROR: Command errored out with exit status 1:
command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/05/2hk0czls3nlgx3p6jfk6jk5h0000gp/T/pip-install-1Ot9ZU/bpy/setup.py'"'"'; __file__='"'"'/private/var/folders/05/2hk0czls3nlgx3p6jfk6jk5h0000gp/T/pip-install-1Ot9ZU/bpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/05/2hk0czls3nlgx3p6jfk6jk5h0000gp/T/pip-install-1Ot9ZU/bpy/pip-egg-info
cwd: /private/var/folders/05/2hk0czls3nlgx3p6jfk6jk5h0000gp/T/pip-install-1Ot9ZU/bpy/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/05/2hk0czls3nlgx3p6jfk6jk5h0000gp/T/pip-install-1Ot9ZU/bpy/setup.py", line 179
def build_cmake(self, extension: Extension):
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How can I deal with it?
This error appeared because you're using Python 2.7, and desired package has Type Hints, which were added only in 3.5 (documentaion).
Upgrade your version of Python

Unable to install ssl in my local system using pip install ssl

I'm very new to python and when i tried to install some lib it is giving me this issue. can you please help on what to do.
When trying to install ssl using pip command it is giving me the below error
"pip install ssl"
Collecting ssl
Using cached https://files.pythonhosted.org/packages/83/21/f469c9923235f8c36d5fd5334ed11e2681abad7e0032c5aba964dcaf9bbb/ssl-1.16.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\rajesh_navaneeth\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RAJESH~1\\AppData\\Local\\Temp\\pip-install-ag0q6n7p\\ssl\\setup.py'"'"'; __file__='"'"'C:\\Users\\RAJESH~1\\AppData\\Local\\Temp\\pip-install-ag0q6n7p\\ssl\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\RAJESH~1\AppData\Local\Temp\pip-install-ag0q6n7p\ssl\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\RAJESH~1\AppData\Local\Temp\pip-install-ag0q6n7p\ssl\setup.py", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
long story short, don't install that python package. It's deprecated (shouldn't be installed in Python 2.6 and newer) and your python already includes ssl package.
In general you shouldn't even be able to install it via pip, but I guess that it's so old that setup.py didn't support version restrictions in the same way it does now.

Categories