I can't install mysqlclient using `pip install mysqlclient` command - python

Here is the console log after ran pip install mysqlclient command.
`(venv) Yu:sagemaker-modeltraining lee$ pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
ERROR: Command errored out with exit status 1:
command: '/Volumes/Work Series/bloc-x/sagemaker/sagemaker-modeltraining/venv/bin/python' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_bfe6faaff6334a44b5df618fa8de82f2/setup.py'"'"'; file='"'"'/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_bfe6faaff6334a44b5df618fa8de82f2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-pip-egg-info-lnpozcvn
cwd: /private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_bfe6faaff6334a44b5df618fa8de82f2/
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_bfe6faaff6334a44b5df618fa8de82f2/setup.py", line 15, in
metadata, options = get_config()
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_bfe6faaff6334a44b5df618fa8de82f2/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_bfe6faaff6334a44b5df618fa8de82f2/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz#sha256=f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 (from https://pypi.org/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached mysqlclient-2.0.2.tar.gz (88 kB)
ERROR: Command errored out with exit status 1:
command: '/Volumes/Work Series/bloc-x/sagemaker/sagemaker-modeltraining/venv/bin/python' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_850f20e68f9b4a9c8db506f4494ef12b/setup.py'"'"'; file='"'"'/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_850f20e68f9b4a9c8db506f4494ef12b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-pip-egg-info-cl3w1t3z
cwd: /private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_850f20e68f9b4a9c8db506f4494ef12b/
Complete output (12 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_850f20e68f9b4a9c8db506f4494ef12b/setup.py", line 15, in
metadata, options = get_config()
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_850f20e68f9b4a9c8db506f4494ef12b/setup_posix.py", line 65, in get_config
libs = mysql_config("libs")
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_850f20e68f9b4a9c8db506f4494ef12b/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
----------------------------------------
enter code here
..........
..........
WARNING: Discarding https://files.pythonhosted.org/packages/6b/ba/4729d99e85a0a35bb46d55500570de05b4af10431cef174b6da9f58a0e50/mysqlclient-1.3.1.tar.gz#sha256=3549e8a61f10c8cd8eac6581d3f44d0594f535fb7b29e6090db3a0bc547b25ad (from https://pypi.org/simple/mysqlclient/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached mysqlclient-1.3.0.tar.gz (76 kB)
ERROR: Command errored out with exit status 1:
command: '/Volumes/Work Series/bloc-x/sagemaker/sagemaker-modeltraining/venv/bin/python' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_c4c84c03c6d84e2ba49d8978d8464e37/setup.py'"'"'; file='"'"'/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_c4c84c03c6d84e2ba49d8978d8464e37/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-pip-egg-info-x9o75gw4
cwd: /private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_c4c84c03c6d84e2ba49d8978d8464e37/
Complete output (10 lines):
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_c4c84c03c6d84e2ba49d8978d8464e37/setup.py", line 17, in
metadata, options = get_config()
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_c4c84c03c6d84e2ba49d8978d8464e37/setup_posix.py", line 47, in get_config
libs = mysql_config("libs_r")
File "/private/var/folders/84/_mv3wv4d54ddl73qj3g3p_nw0000gn/T/pip-install-l1iepknb/mysqlclient_c4c84c03c6d84e2ba49d8978d8464e37/setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/6a/91/bdfe808fb5dc99a5f65833b370818161b77ef6d1e19b488e4c146ab615aa/mysqlclient-1.3.0.tar.gz#sha256=06eb5664e3738b283ea2262ee60ed83192e898f019cc7ff251f4d05a564ab3b7 (from https://pypi.org/simple/mysqlclient/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysqlclient (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3)
ERROR: No matching distribution found for mysqlclient
`
my python version is 3.9.
I was going to use mysql database for my django backend.
here is the setting
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'messagebird',
'USER': 'root',
'PASSWORD': 'messagebird',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
I am not sure why this issue happens.
screenshot enter image description here
enter image description here

https://www.lfd.uci.edu/~gohlke/pythonlibs/ you can simply go in here and use Ctrl+F to find mysqlclient and download it for your machine now use pip install wheel the wheel once installed is available to run from the command line python -m wheel install path_to_the_downloaded_wheel_file now most probably the module will be installed

Pls try using following command lines
pip install path_to_the_downloaded_wheel_file
or
python -m pip install path_to_the_downloaded_wheel_file

Related

Unable to install mysqlclient on ubuntu using pip

I have a following problem. I would like to install MySQLdb. I try pip install mysqlclient but I got this error message:
Collecting mysqlclient
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ydedt20p/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ydedt20p/mysqlclient/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 /tmp/pip-install-ydedt20p/mysqlclient/pip-egg-info
cwd: /tmp/pip-install-ydedt20p/mysqlclient/
Complete output (15 lines):
/bin/sh: 1: mysql_config: not found
/bin/sh: 1: mariadb_config: not found
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ydedt20p/mysqlclient/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-ydedt20p/mysqlclient/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-ydedt20p/mysqlclient/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I am using Python 3.8 on Ubuntu. How can I fix it, please?
Please read and follow the installation instructions for Linux.
For Ubuntu,
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
to install the required libraries before attempting to
pip install mysqlclient

pip installations issues on MacOS with new m1 chip

I just switched from Windows to Mac and cloned my repository. I have the Mac Mini 2020 with the new m1 chip.
I ran pip3 install -r requirements.txt and got the following error:
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/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/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup.py", line 15, in <module>
metadata, options = get_config()
File "/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/t9/czy9qvr930l9s46j8b9k__th0000gp/T/pip-install-npqzencr/mysqlclient/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried with sudo after seeing another post about this issue:
sudo pip3 install -r requirements.txt and got this error:
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-h6hpe889
cwd: /private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup.py", line 15, in <module>
metadata, options = get_config()
File "/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/tmp/pip-install-jqyr1k_y/mysqlclient_c6d45690ebfd45cdbd081164dcfad4ce/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz#sha256=f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 (from https://pypi.org/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysqlclient==2.0.3 (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3)
ERROR: No matching distribution found for mysqlclient==2.0.3
Versions:
Python 2.7.16
pip 19.2.3
When I run check my pip version it clearly shows python 3.8 there:
pip3 --version
pip 19.2.3 from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
Any tips would be LOVELY!
I’ve also had similar experience with M1. I think it’s due to the mysql config. So first of all locate where your mysql_config is ( it can either be in /opt or /bin directories). For instance mine is in:
/opt/homebrew/bin
Once you’ve found the file, you need to edit the file with your favorite editor (I use nano) and change this line in the configuration:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "
change it to this:
# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
after editing install mysqlclient again. You can also ensure that gcc is already installed on your Mac

Errors while installing python modules

PS C:\Users\user> pip install getotp
Collecting getotp
Using cached getotp-0.0.3.tar.gz (3.4 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-nrr48slj\\getotp_f69bcd40d10d4267bbd1b13984d749e6\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-nrr48slj\\getotp_f69bcd40d10d4267bbd1b13984d749e6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');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-umisjc6r'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_f69bcd40d10d4267bbd1b13984d749e6\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_f69bcd40d10d4267bbd1b13984d749e6\setup.py", line 6, in <module>
execfile('getotp/version.py')
NameError: name 'execfile' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a2/dc/6d3cea111d7f77ee7bc222928c176b7d44d9478685e0d1496656be7259d6/getotp-0.0.3.tar.gz#sha256=acf785f72fafb431997f52c67c07645ca78d1c1e464fcc95a313b0649cf7ecd4 (from https://pypi.org/simple/getotp/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached getotp-0.0.2.tar.gz (3.4 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-nrr48slj\\getotp_3e06d6eb791c4df9a1f09d94a9717ef7\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-nrr48slj\\getotp_3e06d6eb791c4df9a1f09d94a9717ef7\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');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-q1vmndlz'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_3e06d6eb791c4df9a1f09d94a9717ef7\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_3e06d6eb791c4df9a1f09d94a9717ef7\setup.py", line 6, in <module>
execfile('getotp/version.py')
NameError: name 'execfile' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fa/3d/43c5ad39ce25cfcbeb7bc41537c59c02ec8a06c10cd3592ef386038e23cb/getotp-0.0.2.tar.gz#sha256=5490fa2a61807d67b0010f0c9e2657a7866e8b026a7576101e5a3c5367a5a80a (from https://pypi.org/simple/getotp/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached getotp-0.0.1.tar.gz (3.2 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-nrr48slj\\getotp_e7a9683866eb4524b60b3692308caf48\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-nrr48slj\\getotp_e7a9683866eb4524b60b3692308caf48\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');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-9dl6hatg'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_e7a9683866eb4524b60b3692308caf48\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-nrr48slj\getotp_e7a9683866eb4524b60b3692308caf48\setup.py", line 6, in <module>
execfile('getotp/version.py')
NameError: name 'execfile' is not defined
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/cd/0e/41efe822de7656c0f8874276e9e06a42e7b941b8029a7678f9cb71cbc03b/getotp-0.0.1.tar.gz#sha256=8199e2d6f3198ce14ee5d9af39f9e4bc581c9b67fb3bad4fb412773095531883 (from https://pypi.org/simple/getotp/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement getotp (from versions: 0.0.1, 0.0.2, 0.0.3)
ERROR: No matching distribution found for getotp
Getting this error while installing packages
That package is from 2014 and was written for python2. Fortunately for you, the code is not very long. You can either download the .tar.gz from pypi or clone the github [repo](https://github.com/gmjosack/getotp]. Then manually go through the code (or use 2to3 on every .py file) and make it python3 compatible and run
python setup.py install
when you are finished.

Installing Pygame on a MacBook Air M1 [duplicate]

This question already has answers here:
pygame installation issue in mac os
(5 answers)
Problems getting pygame to show anything but a blank screen on Macos
(10 answers)
Closed 1 year ago.
I need Pygame 2 for my project.
I have recently been on a Mac with an M1 processor, but I cannot install Pygame.
I installed Python 3.9 with Homebrew, then SDL and others as recommended.
During installation, version 2.01 of Pygame does not install nor version 2.0.0 but only version 1.9.6.
But this version doesn't work with my project, if I run it it tells me that the pigame.mixer module was not found, moreover the project developer is using Pygame 2 methods.
Here is the result of the installation:
Collecting pygame
Using cached pygame-2.0.1.tar.gz (5.5 MB)
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/python#3.9/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_142bfabb2faa435da22f87624750f4cd/setup.py'"'"'; __file__='"'"'/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_142bfabb2faa435da22f87624750f4cd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-pip-egg-info-u1qrzt0i
cwd: /private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_142bfabb2faa435da22f87624750f4cd/
Complete output (27 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using Darwin configuration...
/bin/sh: sdl2-config: command not found
/bin/sh: sdl2-config: command not found
/bin/sh: sdl2-config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_142bfabb2faa435da22f87624750f4cd/setup.py", line 318, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_142bfabb2faa435da22f87624750f4cd/buildconfig/config.py", line 221, in main
deps = CFG.main(**kwds)
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_142bfabb2faa435da22f87624750f4cd/buildconfig/config_darwin.py", line 131, in main
[DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl'])],
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_142bfabb2faa435da22f87624750f4cd/buildconfig/config_unix.py", line 39, in __init__
self.ver = config[0].strip()
IndexError: list index out of range
---
For help with compilation see:
https://www.pygame.org/wiki/MacCompile
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c7/b8/06e02c7cca7aec915839927a9aa19f749ac17a3d2bb2610b945d2de0aa96/pygame-2.0.1.tar.gz#sha256=8b1e7b63f47aafcdd8849933b206778747ef1802bd3d526aca45ed77141e4001 (from https://pypi.org/simple/pygame/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached pygame-2.0.0.tar.gz (5.5 MB)
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/python#3.9/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_b8f2e42671424b84b18377944477dc5e/setup.py'"'"'; __file__='"'"'/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_b8f2e42671424b84b18377944477dc5e/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-pip-egg-info-x9rp8x3u
cwd: /private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_b8f2e42671424b84b18377944477dc5e/
Complete output (27 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using Darwin configuration...
/bin/sh: sdl2-config: command not found
/bin/sh: sdl2-config: command not found
/bin/sh: sdl2-config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_b8f2e42671424b84b18377944477dc5e/setup.py", line 318, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_b8f2e42671424b84b18377944477dc5e/buildconfig/config.py", line 221, in main
deps = CFG.main(**kwds)
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_b8f2e42671424b84b18377944477dc5e/buildconfig/config_darwin.py", line 131, in main
[DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl'])],
File "/private/var/folders/w8/n1kdqpdn6_q0893qnv348s580000gn/T/pip-install-6mir4cqu/pygame_b8f2e42671424b84b18377944477dc5e/buildconfig/config_unix.py", line 39, in __init__
self.ver = config[0].strip()
IndexError: list index out of range
---
For help with compilation see:
https://www.pygame.org/wiki/MacCompile
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bc/0c/d164411381bada8feae57359aa9296defbed3035f4b55bef6a271cb0573c/pygame-2.0.0.tar.gz#sha256=63b038da116a643046181b02173fd894d87d2f85ecfd6aa7d5ece73c6ef501e9 (from https://pypi.org/simple/pygame/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached pygame-1.9.6-cp39-cp39-macosx_11_0_arm64.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.6
Thank you for your help !

Problem installation of mysql instance of python

In mac OSX I have already installed mariadb 10.1.20 now while i Try to install mysql-python using pip install mysql-python system showing following error:
Collecting mysql-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
ERROR: Command errored out with exit status 1:
command: /Users/eskimi/Development/ErpNext/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-s0tXN_/mysql-python/setup.py'"'"'; __file__='"'"'/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-s0tXN_/mysql-python/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/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-s0tXN_/mysql-python/pip-egg-info
cwd: /private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-s0tXN_/mysql-python/
Complete output (10 lines):
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/1r/0z4_dp3j0237vqx1jvc0sn3c0000gp/T/pip-install-s0tXN_/mysql-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How can resolve this issue?
N.B I am using python 2.7

Categories

Resources