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.
Related
I couldn't install it in any way, I wonder what could be the cause of the error.
I installed C++ and other necessary stuff
I am using windows 11
I installed pip install nvidia-pyindex with no problem.
Same as tensorrt I can't install pycuda library and I get same error
\`
(base) PS C:\\Users\\byara\> pip install nvidia-tensorrt
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting nvidia-tensorrt
Downloading nvidia-tensorrt-0.0.1.dev5.tar.gz (7.9 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─\> \[17 lines of output\]
Traceback (most recent call last):
File "\<string\>", line 2, in \<module\>
File "\<pip-setuptools-caller\>", line 34, in \<module\>
File "C:\\Users\\byara\\AppData\\Local\\Temp\\pip-install-ak3sxwfw\\nvidia-tensorrt_a7512906bd3241728853c0e6a10bf9d4\\setup.py", line 150, in \<module\>
raise RuntimeError(open("ERROR.txt", "r").read())
RuntimeError:
\###########################################################################################
The package you are trying to install is only a placeholder project on PyPI.org repository.
This package is hosted on NVIDIA Python Package Index.
This package can be installed as:
`
$ pip install nvidia-pyindex
$ pip install nvidia-tensorrt
`your text`
###########################################################################################
[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.
\`
TensorRT is not available for Windows via pip. You can verify that by looking at the wheel files in PyPI, link. All the wheel files for the latest version are for Linux. Thus, trying to install on Windows will pick the previous releases, which were place-holder packages. Those releases just print the message you are seeing, on all OSes.
According to the documentation
The zip file is the only option currently for Windows.
You can find instructions on how to install at Zip File Installation.
(tensorholo) C:\Users\alaba\Desktop\MIT PROJECT\tensor_holography-main>pip install nvidia-tensorflow[horovod]
Collecting nvidia-tensorflow[horovod]
Downloading nvidia-tensorflow-0.0.1.dev5.tar.gz`` (7.9 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\alaba\AppData\Local\Temp\pip-install-ztjzt002\nvidia-tensorflow_001bf7a090024c37a3c7ff91374ac7c4\setup.py", line 150, in <module>
raise RuntimeError(open("ERROR.txt", "r").read())
RuntimeError:
###########################################################################################
The package you are trying to install is only a placeholder project on PyPI.org repository.
This package is hosted on NVIDIA Python Package Index.
This package can be installed as:
```
$ pip install nvidia-pyindex
$ pip install nvidia-tensorflow
```
Please refer to NVIDIA instructions: https://github.com/NVIDIA/tensorflow#install.
###########################################################################################
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.
nvidia-tensorflow[horovod] package doesn't support the Windows platform. You'd need to run it inside a WSL2 (Windows Subsystem for Linux version 2) to make it work on Windows.
Like the official docs say:
The nvidia-tensorflow package includes CPU and GPU support for Linux.
And also this issue on the same repository:
Collecting cryptography
Downloading cryptography-37.0.2.tar.gz (585 kB)
-------------------------------------- 585.4/585.4 kB 7.4 MB/s eta 0:00:00
Installing build dependencies ... error
error: subprocess-exited-with-error
pip subprocess to install build dependencies did not run successfully.
exit code: 1
[41 lines of output]
Collecting setuptools!=60.9.0,>=40.6.0
Using cached setuptools-62.3.1-py3-none-any.whl (1.2 MB)
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting cffi>=1.12
Using cached cffi-1.15.0.tar.gz (484 kB)
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
[16 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:/Users/####/AppData/Local/Temp/pip-install-myhhpkap/cffi_c72832fd79d3476b80c36655663d2237/setup.py", line 126, in <module>
if sys.platform == "win32" and uses_msvc():
File "C:/Users/####/AppData/Local/Temp/pip-install-myhhpkap/cffi_c72832fd79d3476b80c36655663d2237/setup.py", line 105, in uses_msvc
return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
File "C:/msys64/mingw64/lib/python3.9/site-packages/setuptools/_distutils/command/config.py", line 225, in try_compile
self._compile(body, headers, include_dirs, lang)
File "C:/msys64/mingw64/lib/python3.9/site-packages/setuptools/_distutils/command/config.py", line 132, in _compile
self.compiler.compile([src], include_dirs=include_dirs)
File "C:/msys64/mingw64/lib/python3.9/site-packages/setuptools/_distutils/_msvccompiler.py", line 327, in compile
self.initialize()
File "C:/msys64/mingw64/lib/python3.9/site-packages/setuptools/_distutils/_msvccompiler.py", line 218, in initialize
raise DistutilsPlatformError("--plat-name must be one of {}"
distutils.errors.DistutilsPlatformError: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
[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.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
pip subprocess to install build dependencies did not run successfully.
exit code: 1
See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Pip and setuptools are both completely up to date, I have rust installed, and linked to the x86_64-pc-windows-gnu toolchain, and I have the C++ tools from VS. I have even tried completely reinstalling msys2 and it still gives me the same error every single time. I have gotten this installed this way before so I know it is possible, but it was on a different machine and I didn't run into this issue. I am really at a loss as to how to get this installed so any help would be greatly appreciated.
Edit: So after a bit more hunting and searching. I realized that there is a msys2 package for the cryptography library that you need to use instead of trying to use pip. As far as I can tell there is some sort of compilation error that results from running it in the msys2 environment instead of a windows terminal that is causing it. Here is the package I used https://packages.msys2.org/package/mingw-w64-x86_64-python3-cryptography
I type pip install conda in cmd but it came out like this :
Collecting conda
Using cached conda-4.3.16.tar.gz (299 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
WARNING: Your current install method for conda only supports conda
as a python library. You are not installing a conda executable command
or activate/deactivate commands. If your intention is to install conda
as a standalone application, currently supported install methods include
the Anaconda installer and the miniconda installer. If you'd still like
for setup.py to create entry points for you, use `utils/setup-testing.py`.
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\PHU PHUC\AppData\Local\Temp\pip-install-fr270g_y\conda_a287c5dfce9b412b845e064492896238\setup.py", line 35, in <module>
import conda._vendor.auxlib.packaging # NOQA
File "C:\Users\PHU PHUC\AppData\Local\Temp\pip-install-fr270g_y\conda_a287c5dfce9b412b845e064492896238\conda\__init__.py", line 13, in <module>
from .common.compat import iteritems, text_type
File "C:\Users\PHU PHUC\AppData\Local\Temp\pip-install-fr270g_y\conda_a287c5dfce9b412b845e064492896238\conda\common\compat.py", line 77, in <module>
from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (C:\Users\PHU PHUC\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
[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.
How can I fix it?
Thanks very much
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>