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.
Related
I'm using xmlsec 1.3.3 in my python web application.
Every time I run a clean pip install, this is the package it hangs on, for about 5 minutes.
The package size is 15KB and pip show a using cached... message, so I guess the time is taken by building some specific security libraries.
Is there a way to do a clean pip install, but without rebuilding the xmlsec related libraries?
xmlsec is distributed in source code only but it's written in C so pip needs to compile it on every fresh installation. It's not possible to not compile it.
You can pre-compile it yourself if you use one specific platform and always install from your package instead of PyPI.
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 ).
I can not for the life of me figure out how to install the package statsmodels for Python 3. It feels like I've tried everything, but nothing is working.
Goal: import statsmodels in python
I start with:
pip install statsmodels
Main error messages:
Failed bulding wheel for statsmodels.
Cython is required to compile statsmodels from a development branch.
Please install Cython or download a source release of statsmodels.
So I try:
pip install cython
Gives:
Requirement already satisfied: cython in c:users\XXX\appdata\roaming\python\python36\site-packages
I installed cython by installing anaconda. I have tried almost all answers I could find by basic googling. But things just don't seem to be working.
Instead of listing the input\output of what I have tried I now only show the first steps, but let me know if you want to see the output of any commands.
How do I continue from here? Any help is appreciated, I've been trying to fix this for several days now and I'm only getting frustrated.
Right now I'm trying:
easy_install cython
This seemed to work, but afterwards pip install statsmodels didn't work.
Command ... failed with error code 1.
I tried:
git clone https://github.com/statsmodels/statsmodels
cd statsmodels
pip install .
And failed with a bunch of errors.
I ran into this same problem lastnight trying to install statsmodels. Finally what worked was installing the Microsoft Visual C++ compiler for Python found here: https://www.microsoft.com/en-gb/download/details.aspx?id=44266 then installing statsmodels by doing pip install statsmodels. I had already installed Cython by using pip. Though I do realize that was for Python 2.7. There doesn't seem to be this compiler available for Python 3.
The main statsmodels on PyPI is very old and uses a nonstandard setup. The release candidate for 0.10.0 is out now, and I would strongly recommend you use this one. You can install it using
pip install statsmodels=0.10.0rc2 --pre
It has wheels for all of the major platforms (Win/OSX/Linux), so you shouldn't see issues related to Cython.
To install statsmodels under anaconda, use
conda install statsmodels
The package is available in the repository of anacondata in version 0.8.0 which is the latest on pip as of now.
anaconda is not "just" a Python installation, it also contains the conda package manager that can install pre-built packages from the main repository of anaconda or from other "channels". It is not advisable to install packages that are available from the anaconda channel with pip, in general.
A comment on the issue of Cython here: to use Cython, your computer needs also a "development environment", that is the availability of a C compiler, of the Python development headers, among others. The C compiler must be compatible with the version of Python for which Cython is installed.
I'm having a hard time setting up python packages. EasyInstall from SetupTools is supposed to help that, but they don't have an executable for Python 2.6.
For instance to install Mechanize, I'm just supposed to put the Mechanize folder in C:\Python24\Lib\site-packages according to INSTALL.txt, but runnning the tests does not work. Can someone help shed some light on this? Thanks!
The accepted answer is outdated. So first, pip is preferred over easy_install, (Why use pip over easy_install?). Then follow these steps to install pip on Windows, it's quite easy.
Install setuptools:
curl https://bootstrap.pypa.io/ez_setup.py | python
Install pip:
curl https://bootstrap.pypa.io/get-pip.py | python
Optionally, you can add the path to your environment so that you can use pip anywhere. It's somewhere like C:\Python33\Scripts.
Newer versions of Python for Windows come with the pip package manager. (source)
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
Use that to install packages:
cd C:\Python\Scripts\
pip.exe install <package-name>
So in your case it'd be:
pip.exe install mechanize
This is a good tutorial on how to get easy_install on windows. The short answer: add C:\Python26\Scripts (or whatever python you have installed) to your PATH.
You don't need the executable for setuptools.
You can download the source code, unpack it, traverse to the downloaded directory and run python setup.py install in the command prompt
Starting with Python 2.7, pip is included by default. Simply download your desired package via
python -m pip install [package-name]
As I wrote elsewhere
Packaging in Python is dire. The root cause is that the language ships without a package manager.
Fortunately, there is one package manager for Python, called Pip. Pip is inspired by Ruby's Gem, but lacks some features. Ironically, Pip itself is complicated to install. Installation on the popular 64-bit Windows demands building and installing two packages from source. This is a big ask for anyone new to programming.
So the right thing to do is to install pip. However if you can't be bothered, Christoph Gohlke provides binaries for popular Python packages for all Windows platforms http://www.lfd.uci.edu/~gohlke/pythonlibs/
In fact, building some Python packages requires a C compiler (eg. mingw32) and library headers for the dependencies. This can be a nightmare on Windows, so remember the name Christoph Gohlke.
I had problems in installing packages on Windows. Found the solution. It works in Windows7+. Mainly anything with Windows Powershell should be able to make it work. This can help you get started with it.
Firstly, you'll need to add python installation to your PATH variable. This should help.
You need to download the package in zip format that you are trying to install and unzip it. If it is some odd zip format use 7Zip and it should be extracted.
Navigate to the directory extracted with setup.py using Windows Powershell (Use link for it if you have problems)
Run the command python setup.py install
That worked for me when nothing else was making any sense. I use Python 2.7 but the documentation suggests that same would work for Python 3.x also.
Upgrade the pip via command prompt ( Python Directory )
D:\Python 3.7.2>python -m pip install --upgrade pip
Now you can install the required Module
D:\Python 3.7.2>python -m pip install <<yourModuleName>>
pip is the package installer for python, update it first, then download what you need
python -m pip install --upgrade pip
Then:
python -m pip install <package_name>
You can also just download and run ez_setup.py, though the SetupTools documentation no longer suggests this. Worked fine for me as recently as 2 weeks ago.
PS D:\simcut> C:\Python27\Scripts\pip.exe install networkx
Collecting networkx
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS reques
t has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may caus
e the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer ve
rsion of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissi
ngwarning.
SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SS
LContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL con
nections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.
readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading networkx-1.11-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 664kB/s
Collecting decorator>=3.4.0 (from networkx)
Downloading decorator-4.0.11-py2.py3-none-any.whl
Installing collected packages: decorator, networkx
Successfully installed decorator-4.0.11 networkx-1.11
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object i
s not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade
to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplat
formwarning.
InsecurePlatformWarning
Or just put the directory to your pip executable in your system path.
As mentioned by Blauhirn after 2.7 pip is preinstalled. If it is not working for you it might need to be added to path.
However if you run Windows 10 you no longer have to open a terminal to install a module. The same goes for opening Python as well.
You can type directly into the search menu pip install mechanize, select command and it will install:
If anything goes wrong however it may close before you can read the error but still it's a useful shortcut.
While I am installing pycairo using easy_install on osx, there is an error message as following:
Searching for pycairo
Reading http://pypi.python.org/simple/pycairo/
Reading http://cairographics.org/pycairo
Best match: pycairo 1.10.0
Downloading http://cairographics.org/releases/pycairo-1.10.0.tar.bz2
Processing pycairo-1.10.0.tar.bz2
error: Couldn't find a setup script in /tmp/easy_install-hnheQI/pycairo-1.10.0.tar.bz2
Please help me out. Thanks in advance.
It looks like pycairo is not set up to be easy_installable (or pipable).
The first problem is that the PyPI package pycairo points at the Python 3.x version, not the 2.x version (which is called py2cairo) This means you can't easy_install or pip install it for 2.x. And they don't have a separate py2cairo PyPI package. So, you'd have to explicitly easy_install http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2.
The second problem is that the tarball isn't designed to be built with setuptools; you have to use waf.
So, you're going to have to download the link above (or, better, the latest py2cairo at http://cairographics.org/pycairo/), untar it, and read and follow the INSTALL directions.
This also assumes that you already have Cairo installed properly (e.g., via Homebrew).
PS, not that it would make any difference here, but you really should be using pip instead of easy_install. The only times you want to use easy_install are to install pip itself (sudo easy_install pip), and to install two or three packages that are easy_installable but not pipable.
You mentioned that you got Cairo through MacPorts. MacPorts doesn't play well with non-MacPorts. In fact, that's kind of the point: to have a completely isolated set of tools and libraries that can be maintained together. This means if you have MacPorts' cairo, you probably want its py27-cairo, and python27 package.
If you want something better integrated with your system, either look for binaries, use Homebrew, or build it yourself. (I noticed that Homebrew also has a formula for py2cairo, which I believe will install into your system 2.7 Python, but I haven't tested it. Normally, Homebrew doesn't supply Python/Ruby/Perl modules, because you've already got pip/gem/cpan, but they make exceptions for packages that don't work with the standard tools and/or are hard to set up.)