Cryptography not installing - python

I've been trying to install cryptography for a while and I keep receiving the same error. I have installed Rust through Rustup and I am using the latest version of Rust. I am also not very savvy when it comes to installations so a basic explanation would be helpful if you can. Thanks.
= note: LINK : fatal error LNK1181: cannot open input file 'python3.lib'
error: could not compile cryptography-rust due to previous error
` 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`

Related

LightFM library install error on Sagemaker Notebook

I was using LightFM library on Sagemaker Notebook without any issue before.
However, from yesterday, I started seeing this error message and could no longer complete installation (pip install lightfm)
Building wheels for collected packages: lightfm
Building wheel for lightfm (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [176 lines of output]
/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/setuptools/dist.py:775: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
...
...
...
...
In file included from /home/ec2-user/anaconda3/envs/python3/include/python3.10/unicodeobject.h:1046:0,
from /home/ec2-user/anaconda3/envs/python3/include/python3.10/Python.h:83,
from lightfm/_lightfm_fast_openmp.c:20:
/home/ec2-user/anaconda3/envs/python3/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' 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.
╰─> lightfm
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I tried several suggestions I found from web, such as
pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade setuptools
pip install Cmake
pip install requests --no-dependencies
but none of these worked - still getting same error message.
How should I mitigate from this error?
This seems to be an issue with the lightfm package installation. Have you tried installing this in another environment? This can also be dependent on the notebook kernel you are using. Can you try installing in a virtual environment as well?

ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects

Python version: 3.11
Installing dependencies for an application by pip install -r requirements.txt gives the following error:
socket.c -o build/temp.linux-armv8l-cpython-311/aiohttp/_websocket.o
aiohttp/_websocket.c:198:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
^~~~~~~ 1 error generated.
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-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 aiohttp
Failed to build aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install
pyproject.toml-based projects
This error is specific to Python 3.11 version. On Python with 3.10.6 version installation goes fine.
Related question: yarl/_quoting.c:196:12: fatal error: 'longintrepr.h' file not found - 1 error generated
Solution for this error: need to update requirements.txt.
Not working versions of modules with Python 3.11:
aiohttp==3.8.1
yarl==1.4.2
frozenlist==1.3.0
Working versions:
aiohttp==3.8.2
yarl==1.8.1
frozenlist==1.3.1
Links to the corresponding issues with fixes:
https://github.com/aio-libs/aiohttp/issues/6600
https://github.com/aio-libs/yarl/issues/706
https://github.com/aio-libs/frozenlist/issues/305

Cannot install "mathutils" in python

I tried everything. From pip and source code. However it keeps showing error.
| ^~~~~~~~~~~~~~
error: command '/usr/bin/gcc' 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.
╰─> mathutils
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I tired with anaconda, with just Python, either pip install or build source package. Nothing is working.

Unable to install pwn package for python

I am trying to install the pwn library on my MacBook Air (M2, 2022) but it's failing while building the wheel for unicorn. I'm using python version 3.10.6.
This is the command I'm using: python3 -m pip install --upgrade pwn
without the --upgrade part I still get the same error message.
If I replace pwn with pwntools I still get the same error message as well.
wtdcode stated in the GitHub issue:
"Due to the fact that GitHub doesn't provide an M1 CI (actions/runner-images#2187), there is no available PyPI release yet. You may build it by yourself."
So my question is, How do I build it myself?
error msg:
Building wheel for unicorn (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
running bdist_wheel
running build
Building C extensions
error: [Errno 2] No such file or directory: '/private/var/folders/6d/85dtjcrj57173csw50tk8r300000gn/T/pip-install-o33_11sd/unicorn_530dd415f77a40418edfdec7c2d599f2/../../include/unicorn'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for unicorn
Running setup.py clean for unicorn
Successfully built psutil
Failed to build unicorn
Installing collected packages: unicorn, pyserial, pyelftools, rpyc, ropgadget, requests, python-dateutil, pysocks, psutil, pathlib2, packaging, mako, intervaltree, colored-traceback, paramiko, pwntools, pwn
Running setup.py install for unicorn ... error
error: subprocess-exited-with-error
× Running setup.py install for unicorn did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
running install
running build
Building C extensions
error: [Errno 2] No such file or directory: '/private/var/folders/6d/85dtjcrj57173csw50tk8r300000gn/T/pip-install-o33_11sd/unicorn_530dd415f77a40418edfdec7c2d599f2/../../include/unicorn'
[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.
╰─> unicorn
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Thank you for your help.
I have an M1 mac and had the same issue—nothing worked for me either, so I eventually just tried installing an older version of unicorn (if you do pip install unicorn== without specifying the version, you can list all of them), and tried different ones until one worked.
(For me, this was just downgrading to 2.0.0)
According to official pwntools documentation, you need building binutils from source. They did make things easy with homebrew:
brew install https://raw.githubusercontent.com/Gallopsled/pwntools-binutils/master/macos/binutils-$ARCH.rb
In order to be able to call the library from Python interpreter, an extra step for me was to use the virtualenv:
source /opt/homebrew/Cellar/pwntools/{PWNTOOLS_VERSION}/libexec/bin/activate

PyQt3D Error While Generating Package Metadata

I am trying to install PyQt3D on my Mac running macOS Monterey. However, when I run python3 -m pip install PyQt3D, I get the following error. I've tried looking it up but was unable to find a solution.
I've tried it with PyQt5, too, and it results in the same error.
Does anyone know what the problem actually is and what I can do to fix it?
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
Collecting PyQt3D
Using cached PyQt3D-5.15.5.tar.gz (7.5 MB)
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]
Querying qmake about your Qt installation...
/opt/homebrew/bin/qmake -query
These bindings will be built: Qt3DCore, Qt3DInput, Qt3DLogic, Qt3DRender, Qt3DAnimation, Qt3DExtras.
Generating the Qt3DCore bindings...
_in_process.py: /private/var/folders/_d/pchrth1s1vjghjhzdbtsngsw0000gn/T/pip-install-sbq5vcl5/pyqt3d_fd2968c9d6a042fa83e3a2e40e291e99/sip/Qt3DCore/qaspectengine.sip:46: ::Qt3DCore::QAspectEngine::aspects() unsupported function return type - provide %MethodCode and a C++ signature
[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.

Categories