How do I fix pip on mac? - python

By usin pip install simpleaudio I get the following:
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 pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting simpleaudio
Using cached simpleaudio-1.0.4.tar.gz (2.0 MB)
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/lc/wc3y14_d4vvbg6jf40sjnd140000gn/T/pip-install-FVBfFS/simpleaudio/setup.py'"'"'; file='"'"'/private/var/folders/lc/wc3y14_d4vvbg6jf40sjnd140000gn/T/pip-install-FVBfFS/simpleaudio/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/lc/wc3y14_d4vvbg6jf40sjnd140000gn/T/pip-pip-egg-info-UA1xfJ
cwd: /private/var/folders/lc/wc3y14_d4vvbg6jf40sjnd140000gn/T/pip-install-FVBfFS/simpleaudio/
Complete output (5 lines):
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/lc/wc3y14_d4vvbg6jf40sjnd140000gn/T/pip-install-FVBfFS/simpleaudio/setup.py", line 42, in
encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Though, I am a Python programmer with little experience. It sounds like your are still using Python 2.7 which has been deprecated(not longer supported). To solve this, I recommend you go to python.org and then hover over the downloads button and then download the current version of Python.

Related

Unable to install pytransform using pip, shows this after entering the command

here's the output:
Using cached https://files.pythonhosted.org/packages/e1/37/c617b7de13cc506f75cbb6b88949f5ca0eb1a8229f3f40e4fe59cd469597/pytransform-0.2.3.2.tar.gz
Collecting MDAnalysis==0.8.1 (from pytransform)
Using cached https://files.pythonhosted.org/packages/9b/45/5cfc731f70af562c860d5b79329980b8b380dd8e283847c950c1f7af8d4c/MDAnalysis-0.8.1.tar.gz
ERROR: Command errored out with exit status 1:
command: 'C:\Python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gunot\\AppData\\Local\\Temp\\pip-install-_fymxu0p\\MDAnalysis\\setup.py'"'"'; __file__='"'"'C:\\Users\\gunot\\AppData\\Local\\Temp\\pip-install-_fymxu0p\\MDAnalysis\\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\gunot\AppData\Local\Temp\pip-install-_fymxu0p\MDAnalysis\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\gunot\AppData\Local\Temp\pip-install-_fymxu0p\MDAnalysis\setup.py", line 58
print "MDAnalysis requires Python 2.6 or better. Python %d.%d detected" % \
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("MDAnalysis requires Python 2.6 or better. Python %d.%d detected" % \)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I dont know why it keeps saying the same error again and again
The package you are trying to install (which is ~ 5 years old) has
MDAnalysis==0.8.1
as a requirement, which is a version from 2014 and was therefore written for python 2x. In your error message you can see that in the setup.py of MDAnalysis, we have the line
print "MDAnalysis requires Python 2.6 or better. Python %d.%d detected" %
which is the python 2x syntax of print(no parantheses).
You have multiple options now:
Try to find a differerent library than pytransform that serves your need and is more up to date
Download the pytransform tar.gz file manually, extract it and replace MDAnalysis==0.8.1 in the requires.txt with MDAnalysis. This is not guaranteed to work though, as the API might have changed
Download the MDAnalysis 0.8.1 source code and try to adjust it to python 3 syntax. This might be a lot of work though
Use python2 for your project. Do note though that python2 has reached it's end of life and is no longer supported, e.g. by the newest version of pip
Note:
Looking at the code of pytransform, option 2 might be the easiest. Even if it doesn't work with the newest MDAnalysis out of the box, the code is only 74 lines long, so changing it to a newer MDAnalysis API should not be too much work

The command "pip install resume-parser" doesn't work [duplicate]

This question already has answers here:
Getting "encoding' is an invalid keyword argument for this function" On Installing pyautogui via PIP
(1 answer)
TypeError: 'encoding' is an invalid keyword argument for this function
(3 answers)
Closed 2 years ago.
I tried the command pip install resume-parser but I get the following 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 pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting resume-parser
Using cached resume_parser-0.6.tar.gz (4.9 MB)
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/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/setup.py'"'"'; __file__='"'"'/private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/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/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-pip-egg-info-BbhRgU
cwd: /private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/7q/gt1dzy7d1js5xbdmw1x36f_00000gn/T/pip-install-95AZbT/resume-parser/setup.py", line 15, in <module>
long_description=open('README.rst', encoding="utf8").read(),
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How can I fix this?
It looks like according to this project's classifiers that it supports Python 3 only, while you are evidently using Python 2.7.* That is also supported by the traceback shown, where Python 2's open() does not take encoding as a keyword argument, whereas Python 3 does.
Install the package using python3 -m pip install or python -m pip install where python links to Python3.
*Technically it could add python_requires as a harder check, but the open() error makes it pretty clear that it is Python3-centric.

How to fix ‘“ERROR: Command errored out with exit status 1:” when trying to install desktop Library using pip?

I am revisiting the python language and I am experiencing difficulty setting up my environment.
I am using - python 3.8.2 (packaged with the system) - robotframework-desktoplibrary 1.0.1 - pip 20.2.3
I encounter an error message when attempting to install desktop library via pip. I believe the error is caused by pip attempting to install in python 3.8 folders (without sufficient permissions) instead of the python 3 folder.
I encounter the following error message when attempting to install robotframework-desktoplibrary via pip:
Collecting robotframework-desktoplibrary
Using cached robotframework-desktoplibrary-1.0.1.zip (15.6 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\shivendra.singh\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\shivendra.singh\\AppData\\Local\\Temp\\pip-install-kcqq2ihh\\robotframework-desktoplibrary\\setup.py'"'"'; __file__='"'"'C:\\Users\\shivendra.singh\\AppData\\Local\\Temp\\pip-install-kcqq2ihh\\robotframework-desktoplibrary\\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\shivendra.singh\AppData\Local\Temp\pip-pip-egg-info-bisto_oa'
cwd: C:\Users\shivendra.singh\AppData\Local\Temp\pip-install-kcqq2ihh\robotframework-desktoplibrary\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\shivendra.singh\AppData\Local\Temp\pip-install-kcqq2ihh\robotframework-desktoplibrary\setup.py", line 4, in <module>
execfile(join(dirname(abspath(__file__)), 'target', 'src', 'SikuliLibrary', 'version.py'))
NameError: name 'execfile' is not defined
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How to resolve this?

Unable to install bsddb3 Python package on macOS Catalina 10.15.4

I've used Homebrew to install berkeley-db and am now struggling to install the bsddb3 Python package. Any help would be much appreciated.
bash-3.2$ BERKELEYDB_DIR=/usr/local/Cellar/berkeley-db/18.1.32_1 pip install bsddb3
Collecting bsddb3
Using cached bsddb3-6.2.7.tar.gz (437 kB)
ERROR: Command errored out with exit status 1:
command: /Users/ryonlife/.local/share/virtualenvs/peg-scrapy-pegbot-ndRdHu61/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/setup.py'"'"'; __file__='"'"'/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/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/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/pip-egg-info
cwd: /private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/setup.py", line 42, in <module>
import setup3
File "/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/setup3.py", line 354, in <module>
db_ver = (int(fullverstr[0]), int(fullverstr[2]))
ValueError: invalid literal for int() with base 10: '.'
Trying to use the Berkeley DB you specified...
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The trick for me was using Homebrew to install berkeley-db#4, rather than berkeley-db.
brew install berkeley-db#4
BERKELEYDB_DIR=$(brew --prefix berkeley-db#4) pip install bsddb3
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You are using macOS 11.1.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this pre-release version.

Unable to install Storm using PIP

Unable to install storm receiving the following error while doing so.
Installed pip version as follows:
pip 19.2.3
pip install storm
Using cached https://files.pythonhosted.org/packages/a7/4c/e5dbc818c432cd80d2e1aa1576f911eda49a3c206c6697db4070f402cda9/storm-0.20.tar.bz2
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lk/wrg280_17c78l9kysqx26pdc0000gp/T/pip-install-so_kwd18/storm/setup.py'"'"'; __file__='"'"'/private/var/folders/lk/wrg280_17c78l9kysqx26pdc0000gp/T/pip-install-so_kwd18/storm/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: /private/var/folders/lk/wrg280_17c78l9kysqx26pdc0000gp/T/pip-install-so_kwd18/storm/
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/lk/wrg280_17c78l9kysqx26pdc0000gp/T/pip-install-so_kwd18/storm/setup.py", line 5, in <module>
import ez_setup
File "/private/var/folders/lk/wrg280_17c78l9kysqx26pdc0000gp/T/pip-install-so_kwd18/storm/ez_setup.py", line 106
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
When trying to install strom i am receiving the above error.
The package storm for Python has not been maintained. The latest version 0.20 is released at 2013. The project doesn't support Python 3 at all.
It's in package, syntax error. You need to change comma(this symbol ' , ') in said line:
File
"/private/var/folders/lk/wrg280_17c78l9kysqx26pdc0000gp/T/pip-install-so_kwd18/storm/ez_setup.py",
line 106
except pkg_resources.VersionConflict, e:
to 'as', it should look like:
except pkg_resources.VersionConflict as e: # in package there is ','
But if you are just starting project, DO NOT use storm, as it's last update was nearly 7 years ago and it's not clear if it's compatible with python 3.
I don't know what you are using it for but search for something with constant support. If you are not sure which package is getting support search for last realease date on:
PyPi library
Installing directly from shell / terminal may help rather then to do it in program.

Categories

Resources