Pygame not installing in pip [duplicate] - installation

This question already has answers here:
Python pygame not installing
(3 answers)
Unable to install Pygame using pip
(27 answers)
Closed 3 months ago.
when I try to install pygame in my cmd(as admin), vscode, pycharm I always get the same error that says:
error: subprocess- exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
and
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.
Also I need to mention that I don't have any problems with installing other modules since I downloaded 'pandas' and it worked just fine.
I made sure to have pip installed to max version and python as well, I gave it a try multiple times but it doesn't work. I also watched tons of YouTube videos on this but nobody seems to have that problem. I expected it to simply download but there is always these same errors popping up.
Thank you for your time,
any help would be appreciated.

Related

how to download sent2vec library

So I'm trying to download sent2vec (this one: https://github.com/epfml/sent2vec) on windows, and I have issues with that.
to my understanding, pip installs won't work because it will get a different package with the same name.
I tried to download the library by manually git cloning the sent2vec and fastText libraries and then using pip install . (I got the idea from another thread).
When trying to pip install sent2vec, I get this error:
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.17.1 in c:\python38\lib\site-packages (from sent2vec==0.0.0) (1.24.0)
Requirement already satisfied: Cython>=0.29.13 in c:\python38\lib\site-packages (from sent2vec==0.0.0) (0.29.32)
Building wheels for collected packages: sent2vec
Building wheel for sent2vec (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for sent2vec (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [2 lines of output]
cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x86\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for sent2vec
Failed to build sent2vec
ERROR: Could not build wheels for sent2vec, which is required to install pyproject.toml-based projects
sent2vec requires Facebook's FastText library which builds on Unix (Linux distributions and modern Mac OS). The list of compiler flags is clearly for GCC, they don't work with MSVC.
The bottom line is: the library cannot be built on w64.
sent2vec repository includes a Dockerfile so you can try to use Docker. Or you can try WSL2. Both the Dockerfile and WSL2 run Ubuntu, a Linux distribution.
Upd. The Dockerfile was not updated in 3 years, last commit was on Aug 29, 2019, so it's a bit outdated. The simplest fix currently seems to be editing it after cloning and setting a version in the 1st line: make it FROM ubuntu:18.04

Error installing Geoviews (cartopy) on Windows

after started using and learning Holoviews-Panel-HvPlot, I'd like to learn Geoviews. Unfortunatly, problems started when I tried to install it. Down below the message. Just some more details:
I'm a Windows 10 user
My Python version is 3.10.4
I've just pip3.10 installed last versions of both Geos and Proj (as in the error message)
I've read that Geoviews requires some out of python extensions that I can't get with 'pip' but I have no idea what we're talking about
Someone suggested to use a virtual environment for Anaconda but I don't use it. Moreover,I'd prefer having it installed in my general environment as I hope to use it often in the future.
Anyway, here the Error Message:
Collecting cartopy>=0.18.0
Using cached Cartopy-0.20.3.tar.gz (10.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
<string>:117: UserWarning: Unable to determine GEOS version. Ensure you have 3.7.2 or later installed, or installation may fail.
<string>:166: UserWarning: Unable to determine Proj version. Ensure you have 8.0.0 or later installed, or installation may fail.
Proj version 0.0.0 is installed, but cartopy requires at least version 8.0.0.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel 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.

ERROR: Failed building wheel for skranger

I am trying to install the package skranger using pip install skranger. However, I get an error ERROR: Could not build wheels for skranger, which is required to install pyproject.toml-based projects.
In the traceback, I also see an error ModuleNotFoundError: No module named 'setuptools'. However, setuptools is already installed.
I have tried related solutions already on stackoverflow, but have yet to find a solution. Any help would be greatly appreciated!

Fault in reticulate in rstudio

476/5000
rstudio generates error when running R code with python code. At first the code worked very well but in the second installation it started to generate faults. Here is the link of the code in case you want to play #https: //www.r-bloggers.com/r-and-python-using-reticulate-to-get-the-best-of-both-worlds/
. My laptop is hp 4 gigs of ram and 500 mb of hard disk.
I would greatly appreciate who can explain the failure and how to solve it.
I have reinstalled anaconda last version twice.
library(reticulate)
use_python("/usr/local/bin/python")
use_virtualenv("r-reticulate")
os <- import("os")
Error: lexical error: invalid char in json text.
WARNING: The conda.compat modul
(right here) ------^
os$listdir(".")
Error: object 'os' not found
py_config()
Error: lexical error: invalid char in json text.
WARNING: The conda.compat modul
(right here) ------^
Actually, it comes from a deprecation warning reported a few days ago (fix compat import showing warning #8507).
But the fact is that this warning in "conda.compat" generates some errors, for example in the case of using conda environments in R through "reticulate" functions. This issue has been reported quite recently Conda warnings taken as errors #477.
The solution is to simply install the github version of "reticulate" in order to avoid these errors and ignore the conda warnings which shouldn't necessarily impede these functionalities. You can do it like this way:
remotes::install_github("rstudio/reticulate")
And don't forget to have the latest Rtools installed in your operating system!
This might be useful for you: https://docs.anaconda.com/anaconda/user-guide/tasks/switch-environment/
I have Anaconda, and set up Python 2 environment. Once activated, run 'use_python' with the path to that environment and set the 'required' parameter to TRUE.
I had the same problem. I solved the problem by installing an older version of conda.
In anaconda promt
conda install conda = 4.1.6

pyinstaller gives weird errors when compiling pandas

UPDATE june 18:
I would like compiling my python code for windows.
I use to work with pyinstaller, python 3.5+, windows 7 and anaconda to control modules pandas, pyqt (v5) and pyqtgraph, but it seems something is not compatible. I would not be surprised if you tell me to change a version.
In previous versions, it worked with python 3.5, windows 7 and Pyinstaller 3.3.1- without pandas; the new version imports pandas and then this doesn’t work anymore:
with the usual config pyinstaller gives a message saying the C libraries are not built. Following the instructions, I should run python setup.py build_ext --inplace --force, except I don’t see the setup.py file, so I don’t know what to do. Forums tell me it should be a problem with pip but not with conda… but I use conda…
with python 3.6, I got an error message ‘RecursionError: maximum recursion depth exceeded’ (https://github.com/steph2016/profiles/blob/master/errorMessage). This problem seems known and solutions I found on forums is either to downgrade python or to replace my PyInstaller-3.3.1 by PyInstaller-3.4.dev0+7b3143612. But with PyInstaller-3.4.dev0+7b3143612 I get a ’’str’ object has no attribute ‘items’’ error (https://github.com/steph2016/profiles/blob/master/ErrorMessage2). I’m not sure pyinstaller is compatible with python 3.6…
with python 3.4, I got an error similar to the ‘str object’ one above. I’m not sure python3.4 is compatible with qt5…
I would be pleased by any solution with any version of whatever to windows-compile my code
I don't know if it is the issue but I didn't find PyQtGraph in Supported-Packages
I eventually applied the first solution proposed in No module named 'pandas._libs.tslibs.timedeltas' in PyInstaller in the original config (python 3.5, PyInstaller 3.3.1, pyqtgraph, pandas, windows 7,...) and it worked.
I don't know why adding def get_pandas_path ..... a.binaries) helps, so I can't justify. But just to be explicit even if it seems obvious: pyinstaller must be run on the spec file, not on the py one (for instance > pyinstaller toto.spec)

Resources