Why am I getting an error when installing Pygame? [duplicate] - python

This question already has answers here:
Can't install new packages for Python (Python 3.9.0, Windows 10)
(6 answers)
Closed 2 years ago.
I am running the command "pip install pygame" in my cmd prompt. I have made sure python is updated and in the path directory, and so is pip. Everything is up to date and working, however whenever I try to install a library, it loads the data, then outputs a huge red error paragraph which I simply can't understand. Please help. This is the error for pygame, I get one 5x bigger when trying to install pandas.
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\VBO\AppData\Local\Temp\pip-install-2g4jyemq\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\VBO\AppData\Local\Temp\pip-install-2g4jyemq\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\VBO\AppData\Local\Temp\pip-install-2g4jyemq\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\VBO\AppData\Local\Temp\pip-install-2g4jyemq\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Python 3.9 is very new and doesn't support a lot of the libraries. Use this if you want to install any:
pip install pipwin
pipwin install <package name>

Related

How to install pywhatkit?

i am having a problem regarding installing pywhatkit in python
version - pycharm 2016, python 3.3.0
Executed command:-
pip install --user pywhatkit
The command output is:-
Collecting pywhatkit
Using cached https://files.pythonhosted.org/packages/6b/f8/7f2763b08be029e5b199178c99b2017533e23c1d9e5e07229fd078e1a183/pywhatkit-5.4.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\user\AppData\Local\Temp\pycharm-packaging\pywhatkit\setup.py", line 12, in <module>
with open("requirements.txt", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
----------------------------------------
DEPRECATION: Python 3.3 supported has been deprecated and support for it will be dropped in the future. Please upgrade your Python.
Command "python setup.py egg_info" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pycharm-packaging\pywhatkit\
I was trying to install it by:
pressing ctrl + alt +s
and then clicking on project interpreter
and then clicking on the '+' icon and installing it from there
Try running the line:
pip install pywhatkit
(At least that is the line I ran when I installed it.)
It looks like package has wrong path for requirements - maybe try to install lower version ?
Or if not try gihtub installation: https://github.com/Ankit404butfound/PyWhatKit/wiki

Cannot install PyGame in PyCharm No setup file exists [duplicate]

This question already has answers here:
How to install pygame?
(4 answers)
Unable to install Pygame using pip
(27 answers)
Closed 11 days ago.
I am trying to install PyGame on PyCharm.
History:
clicked on File -> New projects setup -> settings for new project -> selected python -> click on "+" -> searched "pygame" on search bar -> install package -> ERROR
but I am getting this error:
Collecting pygame
Using cached pygame-2.1.2.tar.gz (10.1 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[77 lines of output]
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Lorak\AppData\Local\Temp\pip-install-cfn9p2mm\pygame_5ad100b5f0cd46c68e6fee4d61f31110\setup.py", line 359, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Lorak\AppData\Local\Temp\pip-install-cfn9p2mm\pygame_5ad100b5f0cd46c68e6fee4d61f31110\buildconfig\config.py", line 225, in main
deps = CFG.main(**kwds)
^^^^^^^^^^^^^^^^
File "C:\Users\Lorak\AppData\Local\Temp\pip-install-cfn9p2mm\pygame_5ad100b5f0cd46c68e6fee4d61f31110\buildconfig\config_win.py", line 511, in main
return setup_prebuilt_sdl2(prebuilt_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(...)
File "C:\Users\Lorak\PycharmProjects\gameproject\venv\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 403, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(...)
---
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[notice] A new release of pip available: 22.3.1 -> 23.0
[notice] To update, run: python.exe -m pip install --upgrade pip`
I don't know how to fit it :(
I tried to install other versions, but there is no difference. Still getting error.
I also tried do it via terminal, but when I use "pip install pygame" another error jumps telling me that "pip is not recognized". I don't know if this is same or other error. I tried to find info on the internet but there is nothing even similar to this error. I have also tried to update pip via manual and it worked, but I am still getting the same error.

ModuleNotFoundError: No module named 'MySQLdb' python macOS high sierra

Everytime I execute my python code, it gives me the above ModuleNotFound error when I execute with python3. With python, it gives me an ImportError.
I have updated setuptools using pip install --upgrade setuptools.
I have also tried multiple commands such as: pip install mysqlclient, pip install MySQL-python, pip install pymysql.
I have tried these commands with pip3 as well (Not sure if it makes a difference).
Everytime I try these commands, it gives me the following error:
Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient/setup_posix.py", line 51, in get_config
libs = mysql_config("libs")
File "/private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient/setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (_mysql_config_path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0y/xsr1t8rs36l0vlq3_f2q42g40000gn/T/pip-install-soxlcjei/mysqlclient
How do I fix this? I am using a macOS High Sierra. I have gone through solutions for similar problems on ubuntu/debian systems and have to tried to apply it here. None of that works on a mac. Also, i already have mysql installed and it works perfectly. It is constantly running on my system.
you should download a tar named as Mysql-python-1.2.4b4.tar.gz, and unzip it, cd to the dir and update the file site.cfg: # mysql_config = /usr/local/mysql/bin/mysql_config to mysql_config = /usr/local/mysql/bin/mysql_config
and then python setup.py install, after you installed the mysql-python,then you can not get the error.

how to customise files being copied into tmp directory when running a local pip install?

I'm trying to pip install the python binding of MXNet library from source code:
https://mxnet.incubator.apache.org/install/ubuntu_setup.html#install-mxnet-for-python
After the main binary is built successfully using g++, there is no problem in installing its python binding in dev/editable mode:
pip install -e .
however when I try to deploy the full package (instead of just creating a symbolic link)
pip install .
I encounter the following error:
Processing ~/git-fork/mxnet/python
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-k3hfc693/setup.py", line 47, in <module>
LIB_PATH = libinfo['find_lib_path']()
File "/tmp/pip-req-build-k3hfc693/mxnet/libinfo.py", line 74, in find_lib_path
'List of candidates:\n' + str('\n'.join(dll_path)))
RuntimeError: Cannot find the MXNet library.
List of candidates:
/tmp/pip-req-build-k3hfc693/mxnet/libmxnet.so
/tmp/pip-req-build-k3hfc693/mxnet/../../lib/libmxnet.so
/tmp/pip-req-build-k3hfc693/mxnet/../../build/libmxnet.so
../../../libmxnet.so
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-k3hfc693/
It appears that pip didn't copy ../../lib/libmxnet.so into tmp since it is outside the python package directory. What should I do to instruct pip to copy that file (and if possible, everything under parent directory) when installing?
Where is your libmxnet.so located? It should be in the main-directory, so in your case: /git-fork/mxnet. Then the setup.py script should work out of the box. You could also manually set the path in setup.py, by adjusting the following line LIB_PATH = libinfo'find_lib_path'

pip install from shortened url

I have put my wheel file at http://long.url.name.com/package-cp27-none-linux_x86_64.whl, and when I do pip install http://long.url.name.com/package-cp27-none-linux_x86_64.whl, it works great. However, when I have a URL shortener forward the above URL and get something like http://short.url/XYZ, and try to do pip install http://short.url/XYZ, pip doesn't work. I notice the download activity, but I see the following error from pip :
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 18, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-2LPqrK-build/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-2LPqrK-build
The problem seems to be that the filename that pip sees for the file is XYZ. This is true when I try to download the file using wget, for instance. However, when I got to http://short.url/XYZ, the file indeed gets downloaded and saved as package-cp27-none-linux_x86_64.whl. So how can I make pip work with the shortened URL?
So it appears that pip cares about the format of the file at the end of the url
so https://aka.ms/foo-1.0.0-py3-none-any.whl works. but if you just have a hask then

Categories