everytime i try to install a package i get the following - python

pip install readline
WARNING: Ignoring invalid distribution -ip (c:\users\gamin\appdata\local\programs\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\users\gamin\appdata\local\programs\python\python310\lib\site-packages)
Collecting readline
Using cached readline-6.2.4.1.tar.gz (2.3 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error: this module is not meant to work on Windows
[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.
WARNING: Ignoring invalid distribution -ip (c:\users\gamin\appdata\local\programs\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\users\gamin\appdata\local\programs\python\python310\lib\site-packages)[enter image description here][1]

Install pyreadline instead of readline:
$pip install pyreadline
or
$python -m pip install pyreadline
Go back to your python file and type:
from pyreadline import Readline
readline = Readline()
As a result, you can use readline on Windows .

It simply isn’t meant for windows. That’s the whole answer. Pyreadline is the package for windows, you can use it for similar results

Related

Quickfix for Python Library installation fails in MacOS

I am trying to install quickfix 1.15.1 (the current latest version available) in MacOS.
OS version is Ventura 15.1. Chip is Apple M2.
Python version is 3.9.6. Clang version is 14.0.0.
But the installation gets failed.
The steps I followed is as follows.
Tried to install using pip3 install quickfix. It was not successful.
Downloaded the source package from pypi and tried to install the package using pip3 install . and pip3 install . --no-binary=:all --user --no-cache-dir. It was not successful.
Cloned the C++ quickfix source code from github and tried to install the library using the commands ./boostrap, ./configure --with-python3 and sudo make install. It was not successful too.
The error I get when trying to install the library in all the above three steps is as follows.
Processing /Users/user/Dependencies/quickfix-1.15.1
Preparing metadata (setup.py) ... done
Building wheels for collected packages: quickfix
Building wheel for quickfix (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─\> \[248 lines of output\]
Testing for std::tr1::shared_ptr...
test_std_tr1_shared_ptr.cpp:1:10: fatal error: 'tr1/memory' file not found
\#include \<tr1/memory\>
^\~\~\~\~\~\~\~\~\~\~\~
1 error generated.
...not found
Testing for std::shared_ptr...
...found
Testing for std::unique_ptr...
...found
C++/AtomicCount.h:163:11: error: unrecognized instruction mnemonic
"lock\n\t"
^
<inline asm>:1:2: note: instantiated into assembly here
lock
^
In file included from C++/DataDictionary.cpp:26:
In file included from C++/DataDictionary.h:30:
In file included from C++/FieldMap.h:30:
In file included from C++/MessageSorters.h:30:
In file included from C++/SharedArray.h:26:
C++/AtomicCount.h:163:18: error: unrecognized instruction mnemonic, did you mean: add, addp, adds, addv, fadd, madd?
"lock\n\t"
^
<inline asm>:2:2: note: instantiated into assembly here
xadd x9, [x8]
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for quickfix
Running setup.py clean for quickfix
Failed to build quickfix
Installing collected packages: quickfix
Running setup.py install for quickfix ... error
error: subprocess-exited-with-error
× Running setup.py install for quickfix did not run successfully.
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> quickfix
note: This is an issue with the package mentioned above, not pip.
Went through different issue threads and docs, but could not find a solution yet. Found this similar stack overflow post as well. But a solution could not be found there too.

INSTALL_PREFIX environment variable must be set error

pip install python-ghost-cursor
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
Collecting bezier
Using cached bezier-2021.2.12.tar.gz (313 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
The BEZIER_INSTALL_PREFIX environment variable must be set.
[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.
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
I'm fairly inexperienced with installing libraries and so I don't know how to set the environment variable in question. Help would be appreciated. This was all done in a specific directory in the Win10 command line.
This isn't something you did wrong, this is a bug from the bezier library which is a dependency of the package you are trying to install.
The solution is to use python version 3.9
Here is a link to the issue on github
Or here is the explanation from the maintainer.
I haven't cut a release of bezier since Python 3.10 was released, so there are no pre-built wheels for 3.10.
If you want to install pure-Python without the extension, follow the docs https://bezier.readthedocs.io/en/2021.2.12/#installing:
BEZIER_NO_EXTENSION=true
python -m pip install --upgrade bezier --no-binary=bezier
If you want to install with the binary extension (i.e. with cmake as you mentioned), from the dev docs https://bezier.readthedocs.io/en/2021.2.12/development.html#libbezier:
SRC_DIR="src/fortran/"
BUILD_DIR=".../libbezier-debug/build"
INSTALL_PREFIX=".../libbezier-debug/usr"
mkdir -p "${BUILD_DIR}"
cmake
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}"
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-S "${SRC_DIR}"
-B "${BUILD_DIR}"
cmake
--build "${BUILD_DIR}"
--config Debug
--target install
then you can run
BEZIER_INSTALL_PREFIX="${INSTALL_PREFIX}" python -m pip install bezier

Python - BPIPE API python SDK installation error

I'm getting this error message when trying to install BPIPE API python SDK
command
pip3 install --index-url=https://bcms.bloomberg.com/pip/simple blpapi
error message
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Looking in indexes: https://bcms.bloomberg.com/pip/simple
Collecting blpapi
Using cached https://bcms.bloomberg.com/pip/simple/blpapi/blpapi-3.18.3.tar.gz (304 kB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
Looking in indexes: https://bcms.bloomberg.com/pip/simple
ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
ERROR: No matching distribution found for setuptools>=40.8.0
[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.

How can I solve problems installing packages in python (Failed building wheels)?

I'm trying to install several packages in Google Colab (python 3.7) and I find some errors.
The packages I'm installing are:
pillow==4.2.1
numpy==1.16.1
pandas==0.20.3
scipy==0.19.1
scikit-image==0.13.0
scikit-learn==0.19.1
matplotlib==2.2.2
tensorflow==1.2.1
concurrent-iterator==0.2.6
At first, I do:
!pip install --upgrade pip setuptools wheel
Then, I do the next (it is an example of one package):
!pip install pillow==4.2.1
But whit packages 4, 5 and 6 I found the next error:
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting scipy==0.19.1
Using cached scipy-0.19.1.tar.gz (14.1 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: scipy
error: subprocess-exited-with-error
× python setup.py bdist_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.
Building wheel for scipy (setup.py) ... error
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
error: subprocess-exited-with-error
× python setup.py clean 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 cleaning build dir for scipy
Failed to build scipy
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
Installing collected packages: scipy
Attempting uninstall: scipy
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
Found existing installation: scipy 1.4.1
Uninstalling scipy-1.4.1:
Successfully uninstalled scipy-1.4.1
error: subprocess-exited-with-error
× Running setup.py install for scipy 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.
Running setup.py install for scipy ... error
WARNING: No metadata found in /usr/local/lib/python3.7/dist-packages
Rolling back uninstall of scipy
Moving to /usr/local/lib/python3.7/dist-packages/scipy-1.4.1.dist-info/
from /usr/local/lib/python3.7/dist-packages/~cipy-1.4.1.dist-info
Moving to /usr/local/lib/python3.7/dist-packages/scipy/
from /usr/local/lib/python3.7/dist-packages/~cipy
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> scipy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
After that, the version installed is the default in Google Colab, not the one I want.
I found this error only with packages 4, 5 and 6 and, after looking for information on internet, i didn't find a solution. I can't install modern versions because I need those in particular.

Cannot install pyansys using pip install

I am on Pycharm and wish to install the pyansys package, but I keep getting this error:
Collecting pyansys
Using cached pyansys-0.61.3.tar.gz (11 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
*** PyAnsys has moved (and expanded!) ***
To use PyAnsys you need to install the applicable packages for your
product:
MAPDL:
- ``pip install ansys-mapdl-core``
MAPDL Post-Processing:
- ``pip install ansys-mapdl-reader``
- ``pip install ansys-dpf-core``
- ``pip install ansys-dpf-reader``
PyAEDT
- ``pip install pyaedt``
[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.
So I went ahead and installed all but one of those packages. I also installed cython. The only package that cannot be installed is ansys-dpf-reader and here is its error message
ERROR: Could not find a version that satisfies the requirement ansys-pdf-reader (from versions: none)
ERROR: No matching distribution found for ansys-pdf-reader
What is going on?
So it seems like 'ansys-dpf-reader' was changed to 'ansys-dpf-post' and the 'pyansys' is not a pacakge anymore, but has now expanded into these 5 packages. Installing all of them will allow the normal use of the old pyansys.
https://docs.pyansys.com/

Categories

Resources