setup.py egg_info error code 3221225477 - python

I've been trying to install IMGAUG package for an ML project. But the installation gets stuck when it tries to install scikit-image
My input: pip install scikit-image
output:
Collecting imgaug
Using cached
https://files.pythonhosted.org/...
Requirement already satisfied: scipy in
c:\users\*<username>*\appdata\local\programs\python\python37\lib\site-
packages (from imgaug) (1.1.0)
Collecting scikit-image>=0.11.0 (from imgaug)
Using cached https://files.pythonhosted.org/packages/...
Complete output from command python setup.py egg_info:
----------------------------------------
Command "python setup.py egg_info" failed with error code 3221225477 in
C:\Users\<name>~1.<name2>\AppData\Local\Temp\pip-install-qmdp6ysz\scikit-image\
Note: I've already tried installing other versions of it, upgrading setuptools and pip. Error persists.
PS: Now it's showing up on everything I try to install.

(Scroll down to a horizontal line to skip explanation and go straight to the suggested solution if you wish)
3221225477 is 0xC0000005 which is NTSTATUS STATUS_ACCESS_VIOLATION; the corresponsing error message is The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s..
In Windows, a process usually quits with this exit code if it tries to access an invalid memory address and Windows terminates it as a result. If you install Visual Studio, you'll be able to pinpoint the exact module at fault as shown on the link.
Now, this error means a bug in or an incompatibility between some of your installed extension modules (or in Python engine itself, but this is very unlikely in comparison).
The easiest way to fix is to clean up any problems with the involved modules' installation and (if that isn't enough) update them to the latest versions, hoping that whatever is causing that is fixed in them.
In particular, scipy in c:\users\*<username>*\appdata\local\programs\python\python37\lib\site-packages looks suspicious: you aren't using --user in your pip command
which suggests that your didn't pay attention to this flag when using pip before (it's official that it CAN lead to version conflicts), and some of your installed packages are installed both into %ProgramFiles%\Python37\Lib\site-packages and %APPDATA%\Python\Python37\ib\site-packages, with different versions in these two locations.
I hereby suggest you to:
decide where you want your 3rd-party modules to be
%ProgramFiles% is system-wide and requires elevation to manage, %APPDATA% is per-user and doesn't require elevation
Unless you don't have administrative rights at your machine (you do, judging by the command you gave) or have special needs, keep everything in the system-wide location for simplicity
uninstall all the modules in the other location (pip uninstall <name(s)> with or without --user)
reinstall them to the desired location, updating existing versions (-U pip flag)
if that wasn't enough to solve the problem (very unlikely), update all packages to the latest versions

This happened to me also. However I resolved it by uninstalling the package (pip uninstall ), then installing it using conda rather than pip (conda install ).

Related

Problem in installing ecapture in python 3.10

I was just preparing to make a voice assistant and an error occurred while I was installing the ecapture module in python. I used pip for installing and the error is as shown below.
Failed to build scikit-image
ERROR: Could not build wheels for scikit-image, which is required to install py.project.toml-based projects
I have tried to install it from PyPI
even I do have tried to restart my computer, reinstall python, etc.
but it doesn't just work.
Note: only use this answer if you trust binaries built by Christoph Gohlke, who maintains an excellent index of binaries here https://www.lfd.uci.edu/~gohlke/pythonlibs/
You can either grab the needed packages from there manually, or use this package (which I wrote, full disclosure):
pip install gohlkegrabber
ggrab . scikit-image
pip install scikit_image-0.19.0-cp310-cp310-win_amd64.whl
pip install ecapture
Note that the package you were lacking is scikit-image - you may be able to find binaries elsewhere as well, the site above is only provided as a suggestion. Again, only use if you trust the author.
Also note that the package was called scikit_image-0.19.0-cp310-cp310-win_amd64.whl for me, as I'm on Python 3.10 on 64-bit Windows. Yours may have a different name (if available), but the ggrab command will tell you.
Finally note that 0.19.0 just happens to be the most recent build on that site - it's not guaranteed to have the latest build, or to have the latest build for your OS/version of Python.

I'm hitting a roadblock when trying to install Cython

I'm trying to install Cython, which I need for using another package. I have Xcode and a C compiler. I'm using a Mac (Big Sur) with python 3.9, but I have no experience with C.
I first tried using pip:
pip3 install Cython
This resulted in the message
Requirement already satisfied: Cython in /usr/local/lib/python3.9/site-packages (0.29.23)
and I was unable to import the package into my editor, Idle. Usually, every package I install goes to
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
so I tried downloading the zip file from https://github.com/cython/cython and placing it in the above site-packages directory. At the terminal, I changed to the directory cython-master and entered
python3 setup.py install
which seemed to work since a number of messages popped up on my screen, none indicating errors, and the whole thing ending with
Installed /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-
packages/Cython-3.0a7-py3.9-macosx-10.9-x86_64.egg
Processing dependencies for Cython==3.0a7
Finished processing dependencies for Cython==3.0a7
However, I'm still receiving a module not found error a my shell in Idle.
Typically happens with a wrong pip executable.
Use $ python -mpip install
Use virtualenverapper (or the standard library venv module)

pip: uninstalling a disutils installed package

I am trying to install psutil with the command pip install -U psutil and that gives me the error:
Cannot uninstall 'psutil'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
It seems like this is a known issue in pip with versions > 10, and I understand that part (I currently have pip 18). But I just found that I can solve it by directly doing a pip install psutil without using the Upgrade flag. I was wondering if there is a reasoning behind that. My initial sense is that in the first case, where pip tries to upgrade, it first tries to remove the package, which it cannot, but in the latter case it tries to install directly, and hence does not get the error. My question is does it still not have to remove the package first and install (when not using the Upgrade flag), or why specifically is it that pip gives an error with an Upgrade flag but no error without it.
EDIT: So, I tried to run pip install -v psutil as hoefling suggested, and I got a whole bunch of text, as opposed to saying that requirements already met, which means that psutil didn't get installed in the first place. I tried to figure this a bit, and this is what I understand so far: I was running inside a python virtualenv and installing it by means of pip -U -r requirements.txt where requirements.txt contains a bunch of packages including psutil. When I remove the -U flag, it skips installing psutil, and jumps over to other packages. Which raises another question, whether this is how pip is supposed to behave when there is no -U flag. Its interesting that the first time, when its installing the packages with the -U flag, it looks inside the main python installation instead of the virtual environment one, and when the -U flag is removed it doesn't do that and skips entirely.
There are some setups where you have a bunch of packages installed somewhere that isn't the normal install location for setuptools, and comes after the normal install location on sys.path.
Probably the most common of these setups is Apple's pre-installed Python 2.7, so I'll use it as an example. Even if that isn't your setup, it will be hopefully still be instructive.
Apple includes an Extras directory (at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), with a bunch of third-party packages that either Apple's own tools need, or that Apple thought you might want (back when Apple cared about providing the best Python experience of any platform).
For example, on macOS 10.13, that directory will include NumPy 1.8.0.
These packages are all installed as distribute-style eggs.
(Some linux distros do, or at least used to do, similar things, with Python packages built as RPM/DEB/etc. packages, which go into adistutils directory, unlike things you install via pip or manually, which go into a setuptools directory. The details are a bit different, but the effects, and the workaround, end up being the same.)
If you install pip, and then try to pip install -U numpy or pip uninstall numpy, pip will see the distribute-style numpy-1.8.0rc1-py2.7.egg-info file and refuse to touch it for fear of breaking everything.
If you just pip install numpy, however, it will look only in the standard site-packages installation location used by setuptools, /Library/Python/2.7/site-packages, see nothing there, and happily install a modern version of NumPy for you.
And, because /Library/Python/2.7/site-packages comes before /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python on your sys,path, the new NumPy will hide the ancient NumPy, and everything will just work as intended.
There can be a few problems with this. Most notably, if you try to install something which isn't included in Extras itself, but which has a dependency that is included in Extras, it may fail with mysterious and hard-to-debug errors. For example, on macOS 10.12, pip install pandas will throw a bunch of errors at you about not being able to upgrade dateutil, which you didn't even know you were trying to do. The only thing you can do is look at the dependencies for pandas, see which ones are pre-installed in Extras, and manually pip install shadowing versions of all of them.
But, for the most part, it works.

Install pyinstaller with no internet access

I'm trying to install pyinstaller on a windows 7 machine with no internet access at all. I've been following the manual as much as I can but I'm totally new to python, pip and whatnot. I downloaded the archive for PyPI and unzipped it to my local drive. After installing PyPiWin32 I CD'd to the pyinstaller folder and ran C:\python27\python setup.py install. It seemed like everything was installing fine but then I got an error that pyinstaller was looking for the "future" package online, and of course couldn't find it...
So then I looked through the manual some more and tried running pip pyinstaller install which now gives me this error
Could not find a version that satisfies the requirement future (from pyinstaller) (from versions: )
No matching distribution found for future (from pyinstaller)
So what I assume went wrong (and I'm really not familiar with this) is that I tried an install, it missed some vital package because that was online, and now it is a bit confused. So is there a way to manually install the "future" package or am I just doing this totally wrong?
Looking at their setup.py file they append a separate future package from PyPI, so you need to install that too before installing PyInstaller on Windows.
When in doubt, you can find a required package using this pattern:
https://pypi.python.org/pypi/<package>
and mostly (if not in all cases) it'll work just fine, therefore if you have a missing package future, just drop it into this url:
https://pypi.python.org/pypi/future
About the future package, it seems they require additional packages on Python 2.6, therefore you'll need importlib and argparse too judging from future's setup.py:
if sys.version_info[:2] == (2, 6):
REQUIRES += ['importlib', 'argparse']
TEST_REQUIRES += ['unittest2']
And just a note for installing, it's easier to navigate into a folder with a setup.py file and do:
pip install .
as it installs like it'd with pip install <package> therefore it'll be easier to uninstall a desired package.
In the end you'd do probably better to go for this question's solutions and download all required packages first with the same environment you want to target. Then you'll just point pip to the right folder, or install manually.

Unable to install 64-bit Pygame on Python 3.4

I have 64-bit python 3.4 installed, which comes with pip. I wanted to install pygame, and I know that the 32 bit version that they have on their site wouldn't work with my version of python. So I downloaded the 64-bit python 3.4 pygame package from here (pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl). I renamed the package to pygame.whl and tried to use pip on the command line to install it, but it gave me this error;
Collecting pygame
Could not find a version that satisfies the requirement pygame (from versions:
)
Some externally hosted files were ignored as access to them may be unreliable
(use --allow-external pygame to allow).
No matching distribution found for pygame
So I tried using the --allow-external option, but it gave me a different error and asked me to provide a requirements file. I looked around, and found that I might need to try using the --pre option, but it gave me the exact same error as above regardless. How can I install the package?
The most likely reason you failed to install the .whl package is that you typed
pip install pygame
at the command prompt, instead of switching to the directory where you stored your renamed pygame.whl and running
pip install pygame.whl
pip requires that you give the full name of the file being installed.
The error message you got indicates that you ran the first command, and pip was looking in PyPI for pygame (which isn't there). The --allow-external command would have allowed you to specify a remote location where a source file or .whl file could be found.
In the future, I'd recommand not renaming the files downloaded from the (quite excellent) site you linked to, so that when you try to install them you're sure you're running the right command. Remember, you can always use Tab to complete file names on the command line.

Categories

Resources