installing slycot issue [Ubuntu 18.04] - python

I'm trying to install the python slycot package on ubuntu 18.04. But, I can't quite find the way to do it. I keep getting the following error:
alemoreno#alejandro:~$ pip3 install slycot
Defaulting to user installation because normal site-packages is not writeable
Collecting slycot
Using cached slycot-0.4.0.0.tar.gz (1.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from slycot) (1.22.1)
Building wheels for collected packages: slycot
Building wheel for slycot (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for slycot (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [95 lines of output]
Not searching for unused variables given on the command line.
CMake Error at CMakeLists.txt:2 (PROJECT):
Running
'/home/alemoreno/.local/bin/ninja' '--version'
failed with:
Traceback (most recent call last):
File "/home/alemoreno/.local/bin/ninja", line 5, in <module>
from ninja import ninja
ModuleNotFoundError: No module named 'ninja'
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-g8wahozy/slycot_49cb919281814f419e836df3bc561dfd/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The Fortran compiler identification is unknown
CMake Error at CMakeLists.txt:4 (ENABLE_LANGUAGE):
No CMAKE_Fortran_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-g8wahozy/slycot_49cb919281814f419e836df3bc561dfd/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/pip-install-g8wahozy/slycot_49cb919281814f419e836df3bc561dfd/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja" generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying "Unix Makefiles" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Unix Makefiles" generator - failure
--------------------------------------------------------------------------------
********************************************************************************
scikit-build could not get a working generator for your system. Aborting build.
Building Linux wheels for Python 3.9 requires a compiler (e.g gcc).
But scikit-build does *NOT* know how to install it on ubuntu
To build compliant wheels, consider using the manylinux system described in PEP-513.
Get it with "dockcross/manylinux-x64" docker image:
https://github.com/dockcross/dockcross#readme
For more details, please refer to scikit-build documentation:
http://scikit-build.readthedocs.io/en/latest/generators.html#linux
********************************************************************************
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for slycot
Failed to build slycot
ERROR: Could not build wheels for slycot, which is required to install pyproject.toml-based projects
Here are some of the programs that i'm using:
alemoreno#alejandro:~$ pip3 --version
pip 22.0.3 from /home/alemoreno/.local/lib/python3.9/site-packages/pip (python 3.9)
alemoreno#alejandro:~$ ninja --version
1.10.2.git.kitware.jobserver-1
And its location:
alemoreno#alejandro:~$ whereis ninja
ninja: /usr/bin/ninja /home/alemoreno/.local/bin/ninja /usr/share/man/man1/ninja.1.gz
I would really appreciate if someone could help me because i'm wasting a lot of time with this install and i need to get to actually use it.
Thanks in advance.

I installed with conda and it worked for me.
conda install -c conda-forge slycot

Related

Install pyarrow in VS Code for Windows

I am trying to install pyarrow v10.0.0 to a Python 3.11.0 project in both IntelliJ and VS Code. I am using v1.73.0 of VS Code on WIndows 11.
We use a custom JFrog instance to pull all the libraries. To pull the libraries we use the pip manager extension.
I have version 0.38.0 of wheel.
At the top of the output log is the following error message.
Using cached https://xxxjrog.com/artifactory/api/pypi/ENT_WDA_python_virtual/packages/packages/bd/3d/9594c09e1e2fe2e5ed7ef5c22e4347fee2ea243bccd960442e2c97731fd2/pyarrow-10.0.0.tar.gz (994 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: numpy>=1.16.6 in c:\users\app1dwg\appdata\local\programs\python\python311\lib\site-packages (from pyarrow) (1.23.4)
Building wheels for collected packages: pyarrow
Building wheel for pyarrow (pyproject.toml): started
Building wheel for pyarrow (pyproject.toml): finished with status 'error'
Failed to build pyarrow
ERROR: Command errored out with exit status 1:
At the bottom of the output is the following error. I noticed it was using Visual Studio 15 2017 Win64", but I have upgraded to the most recent version of the MS build tools as was suggested in another post.
-- Running CMake for PyArrow C++ cmake -DARROW_BUILD_DIR=build -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=C:\Users\app1dwg\AppData\Local\Temp\pip-install-399aazc6\pyarrow_6bd82e73181f4c8985e52c102dc8bb5e\build\dist
-DPYTHON_EXECUTABLE=C:\Users\app1dwg\AppData\Local\Programs\Python\Python311\python.exe
-DPython3_EXECUTABLE=C:\Users\app1dwg\AppData\Local\Programs\Python\Python311\python.exe
-DPYARROW_CXXFLAGS= -DPYARROW_WITH_DATASET=off -DPYARROW_WITH_PARQUET_ENCRYPTION=off -DPYARROW_WITH_HDFS=off -G "Visual Studio 15 2017 Win64"
C:\Users\app1dwg\AppData\Local\Temp\pip-install-399aazc6\pyarrow_6bd82e73181f4c8985e52c102dc8bb5e\pyarrow/src error: command 'cmake' failed: None
---------------------------------------- ERROR: Failed building wheel for pyarrow
ERROR: Could not build wheels for pyarrow, which is required to
install pyproject.toml-based projects
Any idea what I am doing wrong?
Thanks,
David
Try to use Python version below 3.11.0. According to the content mentioned in github, the package pyarrow does not support Python version 3.11.0 at present

Can't install pyo using pip

When trying to install pyo using pip I get error
$ pip install pyo
Collecting pyo
Using cached pyo-1.0.4.tar.gz (6.1 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 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\VA\AppData\Local\Temp\pip-install-06kfbyzb\pyo_9bd28f6f7eba4c5aa2896ae564b089f6\setup.py", line 293, in <module>
for f in os.listdir(data_files_common_path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
[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.
Then I tried
$ pip install pyo --use-deprecated=backtrack-on-build-failures
DEPRECATION: Backtracking on build failures can mask issues related to how a package generates metadata or builds a wheel. This flag will be removed in pip 22.2. A possible replacement is avoiding known-bad versions by explicitly telling pip to ignore them (either directly as requirements, or via a constraints file). Discussion can be found at https://github.com/pypa/pip/issues/10655
Collecting pyo
Using cached pyo-1.0.4.tar.gz (6.1 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 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\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_d26c3df31ce44e44babd1e5def6de075\setup.py", line 293, in <module>
for f in os.listdir(data_files_common_path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/7a/4a/a681a4c1c6db790b39f24c3384debedd583db48bea47362640ebcab1f3a6/pyo-1.0.4.tar.gz#sha256=34937eba641ed6b1c8ede1c35f30ad5e08493ec1f09352398790910bfd19d445 (from https://pypi.org/simple/pyo/) (requires-python:>=3.6, <4) due to build failure: metadata generation failed
Using cached pyo-1.0.3.tar.gz (5.2 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 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\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_3f80885b827046bbb8de3e7c16e16c7b\setup.py", line 215, in <module>
[os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/60/ea/e717ec9cef74dc4a26000b29b1cf8703e2871d9edaae189dc515d8e74910/pyo-1.0.3.tar.gz#sha256=f0d187a78e3ab9f10275853a22b6a08094aeed4e0c2adee8697734373aa8dd1f (from https://pypi.org/simple/pyo/) (requires-python:>=3.6, <4) due to build failure: metadata generation failed
Using cached pyo-1.0.2.tar.gz (5.2 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 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\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_7636aa31397442f693130603d4cb92d8\setup.py", line 215, in <module>
[os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/4c/48/2b5ea0d2e52edbb3d440fbbf7992f52c9727b2c4117f11b6348abf51706b/pyo-1.0.2.tar.gz#sha256=cb716d2c38a02f3aafba2cb5a47af67d78433580f6536c57fd0883283d3bf64a (from https://pypi.org/simple/pyo/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4) due to build failure: metadata generation failed
Using cached pyo-1.0.1.tar.gz (5.2 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 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\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_9550d20742e24085af8ace9202cb7913\setup.py", line 212, in <module>
[os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/9c/f2/87f07599a2f107f02a9f7cf11599c5eecf37662356296e1236c17ec997f4/pyo-1.0.1.tar.gz#sha256=e85a3e9e4e17769c4178c907e6b8f01bc455fe0fa348b0ce64d5698ec7e82202 (from https://pypi.org/simple/pyo/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4) due to build failure: metadata generation failed
Using cached pyo-1.0.0.tar.gz (5.1 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 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\VA\AppData\Local\Temp\pip-install-_t68yako\pyo_712915a0221348b59415409f622bde9f\setup.py", line 211, in <module>
[os.path.join(data_files_common_path, f) for f in os.listdir(data_files_common_path) if f.endswith(".dll")])]
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'win64dlls\\win64_pyo_data_files_common'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Discarding https://files.pythonhosted.org/packages/67/0f/2c3f9fb88effc62571c209525b5e84d1ec0b68611c916daa96ae8c84f43f/pyo-1.0.0.tar.gz#sha256=4ad45d32ae6ef5865762594223bddf0d6efa7e45657b899b16cda33ce328ebfd (from https://pypi.org/simple/pyo/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4) due to build failure: metadata generation failed
ERROR: Could not find a version that satisfies the requirement pyo (from versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4)
ERROR: No matching distribution found for pyo
The python version
$ python --version
Python 3.10.4
Tried to install AJAX SOUND STUDIO pyo
For AJax Sound studio I tried with latest pyo 0.9.1 but still error persists so I tried with pyo 0.8.4.
Still the issue is not solved.
The above terminal output is from Anaconda Promt from Windows. I also tried to install pyo in Ubuntu. In that OS also I am facing issues with installing PYO.
Terminal output for installation in Ubuntu
$ pip install pyo
Terminal output
tried to install pyo using conda but package is not found
$ conda install pyo
Looking at [PyPI]: pyo 1.0.4 - Download files (newest published version at answer time), prebuilt .whls (for Win) are available if all below apply:
Python version: v3.9, v3.8, v3.7, v3.6
Python arch: pc064 (win_amd64)
Also, building from sources (fall back if no prebuilt .whl available), is complex (and doesn't work OOTB - only tried for Win, but I'm 99% sure that it's the same for Nix) as it requires some additional steps (building / using a bunch of dependencies), so the error pops up (if fixed, another will, and so on).
So, stick with supported Python versions until a new PyO version will be released (this one is 1+ year old). Of course building from sources is an option, but it requires deeper knowledge.
Update #0
Built .whls and published them on [GitHub]: CristiFati/Prebuilt-Binaries - (master) Prebuilt-Binaries/PyO/v1.0.4 (win_amd64 for Python: v3.11, v3.10 and win32 for current Python versions). Check [SO]: Installing pygraphviz on Windows 10 64-bit, Python 3.6 (#CristiFati's answer) (Shortcut section at the end) for details regarding custom .whl installation.
I used the following script to (quickly) test them.
code00.py:
#!/usr/bin/env python
import sys
import time
import pyo
def main(*argv):
sample_name = "Sine"
sample_class = getattr(pyo, sample_name, None)
if sample_class is None:
print("Invalid sample: {:s}".format(sample_name))
return -1
secs = 2
out_file = "{:s}.wav".format(sample_name)
srv = pyo.Server().boot()
print("Playing sound ({:s}) for {:.3f} seconds (and saving to '{:s}') ...".format(sample_name, secs, out_file))
srv.start()
srv.recstart(out_file)
sample = sample_class(mul=0.01).out()
print("Sample: {:}".format(sample))
time.sleep(secs)
srv.recstop()
srv.stop()
sfp = pyo.SfPlayer(out_file)
print("SFP: {:}".format(sfp))
if __name__ == "__main__":
print("Python {:s} {:03d}bit on {:s}\n".format(" ".join(elem.strip() for elem in sys.version.split("\n")),
64 if sys.maxsize > 0x100000000 else 32, sys.platform))
rc = main(*sys.argv[1:])
print("\nDone.\n")
sys.exit(rc)
Output:
[cfati#CFATI-5510-0:e:\Work\Dev\StackOverflow\q073508905]> sopr.bat
### Set shorter prompt to better fit when pasted in StackOverflow (or other) pages ###
[prompt]> :: ------- PYTHON 3.10 -------
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.10_test0\Scripts\python.exe" -m pip install "e:\Work\Dev\GitHub\CristiFati\Prebuilt-Binaries\pyo\v1.0.4\pyo-1.0.4-cp310-cp310-win_amd64.whl"
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing e:\work\dev\github\cristifati\prebuilt-binaries\pyo\v1.0.4\pyo-1.0.4-cp310-cp310-win_amd64.whl
Installing collected packages: pyo
Successfully installed pyo-1.0.4
WARNING: You are using pip version 21.3.1; however, version 22.2.2 is available.
You should consider upgrading via the 'e:\Work\Dev\VEnvs\py_pc064_03.10_test0\Scripts\python.exe -m pip install --upgrade pip' command.
[prompt]>
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.10_test0\Scripts\python.exe" ./code00.py
WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] 064bit on win32
Pyo warning: Portmidi closed.
Playing sound (Sine) for 2.000 seconds (and saving to 'Sine.wav') ...
Sample: < Instance of Sine class >
SFP: < Instance of SfPlayer class >
Done.
[prompt]>
[prompt]> :: ------- PYTHON 3.11 -------
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.11_test0\Scripts\python.exe" -m pip install "e:\Work\Dev\GitHub\CristiFati\Prebuilt-Binaries\pyo\v1.0.4\pyo-1.0.4-cp311-cp311-win_amd64.whl"
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing e:\work\dev\github\cristifati\prebuilt-binaries\pyo\v1.0.4\pyo-1.0.4-cp311-cp311-win_amd64.whl
Installing collected packages: pyo
Successfully installed pyo-1.0.4
WARNING: You are using pip version 21.3.1; however, version 22.2.2 is available.
You should consider upgrading via the 'e:\Work\Dev\VEnvs\py_pc064_03.11_test0\Scripts\python.exe -m pip install --upgrade pip' command.
[prompt]>
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.11_test0\Scripts\python.exe" ./code00.py
WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/
Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54) [MSC v.1932 64 bit (AMD64)] 064bit on win32
Pyo warning: Portmidi closed.
Playing sound (Sine) for 2.000 seconds (and saving to 'Sine.wav') ...
Sample: < Instance of Sine class >
SFP: < Instance of SfPlayer class >
Done.
[prompt]>
[prompt]> :: ------- PYTHON 3.7 (!!! PC032 !!!) -------
[prompt]> "e:\Work\Dev\VEnvs\py_pc032_03.07_test0\Scripts\python.exe" -m pip install "e:\Work\Dev\GitHub\CristiFati\Prebuilt-Binaries\pyo\v1.0.4\pyo-1.0.4-cp37-cp37m-win32.whl"
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing e:\work\dev\github\cristifati\prebuilt-binaries\pyo\v1.0.4\pyo-1.0.4-cp37-cp37m-win32.whl
Installing collected packages: pyo
Successfully installed pyo-1.0.4
WARNING: You are using pip version 20.3.3; however, version 22.2.2 is available.
You should consider upgrading via the 'e:\Work\Dev\VEnvs\py_pc032_03.07_test0\Scripts\python.exe -m pip install --upgrade pip' command.
[prompt]>
[prompt]> "e:\Work\Dev\VEnvs\py_pc032_03.07_test0\Scripts\python.exe" ./code00.py
WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:01:55) [MSC v.1900 32 bit (Intel)] 032bit on win32
Pyo warning: Portmidi closed.
Playing sound (Sine) for 2.000 seconds (and saving to 'Sine.wav') ...
Sample: < Instance of Sine class >
SFP: < Instance of SfPlayer class >
Done.
Note: Needless to say that during each run, an annoying high pitch sound (corresponding to default frequency) was playing for 2 seconds.

Got this error while installing RouterSplot on termux

=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.10.4
platform: Linux-4.9.190-perf-g56d95b3-armv8l-with-libc
pip: n/a
setuptools: 62.3.2
setuptools_rust: 1.3.0
=============================DEBUG ASSISTANCE=============================
error: cargo failed with code: 101
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects

Issue with pip install in virtual environment - Cargo, the Rust package manager, is not installed or is not on PATH

I am using a python virtual environment to work on a project. After setting up my venv and pulling from git I tried to pip install -r requirements.txt but am getting an error below.
Collecting orjson==3.5.2
Using cached orjson-3.5.2.tar.gz (740 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[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.
I am using Python version 3.10.2, pip version 22.0.4.
Any idea how to fix this? I installed rust but no fix.
I am not getting the errors below after moving my virtual enviroment to local.
Collecting orjson==3.5.2
Using cached orjson-3.5.2.tar.gz (740 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
💥 maturin failed
Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
Caused by: `cargo metadata` exited with an error: error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z mutable-noalias=yes --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
--- stderr
error: the option `Z` is only accepted on the nightly compiler
Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', 'C:\\Users\\jawan\\AppData\\Local\\Temp\\pip-modern-metadata-hjcwzhua', '--interpreter', 'C:\\Users\\jawan\\Desktop\\Programming\\imotor\\Scripts\\python.exe', '--manylinux=off', '--strip=on']' returned non-zero exit status 1.
Checking for Rust toolchain....
Running `maturin pep517 write-dist-info --metadata-directory C:\Users\jawan\AppData\Local\Temp\pip-modern-metadata-hjcwzhua --interpreter C:\Users\jawan\Desktop\Programming\imotor\Scripts\python.exe --manylinux=off --strip=on`
[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.
faced the similar problem. after installing 64bit version of python everything is working fine.
The above error is caused by a rust package
pywinpty
all you need do is to remove it from requirements.txt file
and redeploy your app.
Simply install the dependency:
curl https://sh.rustup.rs -sSf | sh
Source: https://doc.rust-lang.org/cargo/getting-started/installation.html
Try installing the rust programming language. It seems like you have a dependency that uses rust. I recommend using brew on OSX.
brew install rust
Otherwise use the rust install page. You can check that rust is installed properly with:
rustc --version
Once you are finished try again to pip install your requirements file.

Building wheel for pywinpty (pyproject.toml) ... error while installing jupyter notebook?

Building wheels for collected packages: pywinpty
Building wheel for pywinpty (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pywinpty (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [72 lines of output]
Running `maturin pep517 build-wheel -i c:\users\aryal\appdata\local\programs\python\python38-32\python.exe`
Compiling proc-macro2 v1.0.36
Compiling unicode-xid v0.2.2
Compiling windows_x86_64_msvc v0.29.0
Compiling libc v0.2.117
Compiling syn v1.0.86
error: could not compile `windows_x86_64_msvc` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --release --lib --`
ðŸ\x8d¹ Building a mixed python/rust project
🔗 Found pyo3 bindings
ðŸ\x90\x8d Found CPython 3.8 at c:\users\aryal\appdata\local\programs\python\python38-32\python.exe
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
error: aborting due to previous error
error: aborting due to previous error
error: aborting due to previous error
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
error: aborting due to previous error
Error: command ['maturin', 'pep517', 'build-wheel', '-i', 'c:\\users\\aryal\\appdata\\local\\programs\\python\\python38-32\\python.exe'] returned non-zero exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pywinpty
Failed to build pywinpty
ERROR: Could not build wheels for pywinpty, which is required to install pyproject.toml-based projects
The errors that I am getting are as follows-:
Building wheels for collected packages: pywinpty
Building wheel for pywinpty (pyproject.toml) ... error
2)error: could not compile windows_x86_64_msvc due to 2 previous errors
3)error: build failed
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit code: 101": cargo rustc --message-format json --manifest-path Cargo.toml --release --lib --
ðŸ\x8d¹ Building a mixed python/rust project
🔗 Found pyo3 bindings
ðŸ\x90\x8d Found CPython 3.8 at c:\users\aryal\appdata\local\programs\python\python38-32\python.exe
error: linker link.exe not found
|
= note: program not found
error: linker link.exe not found
You get this error when your default "python" is the 32 bit. uninstall and reinstall the 64 bit python.

Categories

Resources