poetry fails to install pyyaml with "is not a supported wheel on this platform" error - python-poetry

I have poetry project with pyyaml as a dependency.
Whenever I call poetry install I am getting this error
ERROR: PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl is not a supported wheel on this platform.
Running pip within poetry's virtualenv works just fine
poetry run pip install pyyaml==6.0.0 --force-reinstall
After this step the poetry install also runs fine.
What may be the problem?
I am running this code on MacOS Monterey 12.6, Python 3.8.13

Related

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

I want to install mpi4py.
The installation fails with the error below.
Please share the solution to the same error.
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: python -m pip install --upgrade pip
I installed pyproject-toml with "pip install pyproject-toml".
But mpi4py still won't install.
My python version is Python 3.8.0.
The following worked for me:
sudo apt update
sudo apt-get install libopenmpi-dev
It seems that related packages are twisted.
Installed by following the steps below.
apt --fix-broken install
apt install mpich
pip install mpi4py
For me it worked when I used sudo before:
sudo pip install mpi4py
I had the same error message. I used the Anaconda-Navigator interface and it worked fine.
Another option is to use brew. If OpenMPI isn't a dependency issue for you, the installation worked when I used it as well.
brew install mpi4py

ERROR:Failed building wheel for h5pyFailed to build h5pyERROR:Could not build wheels for h5py,which is required toinstall pyproject.toml-basedprojects

I'm getting this error when I'm running the following command to install tensorflow.
python3 -m pip install tensorflow-macos
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects
I tired to install this wheel manually, from the official link (https://pypi.org/project/h5py/#files), it got installed properly but I'm still getting the same error.
I'm facing the above issue in Mac Book M1 chip.
The official doc to use brew install.
$ brew install hdf5
If the above command gives you rosetta 2 issue, then run:-
arch -arm64 brew install hdf5
Once, the h5py installation is done, run following 2 commands:-
$ export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.0_4 OR export HDF5_DIR=/opt/homebrew/opt/hdf5 (if hdf5 is installed in the "/opt/homebrew/opt/hdf5" location, you have to check it out first)
$ pip install --no-binary=h5py h5py
Note:- in the first command "1.12.0_4" is the version of hdfc installed in my system, you have to change it according to yours.
If you are getting the aforementioned error implies you must be using poetry.
Finally run:-
poetry install
We are running the above command, In case poetry wants to update anything.
Once we run poetry install, it might update existing libraries or download new libraries.
So we have to update poetry.lock file as well.
poetry lock
After installing hdf5 try "export HDF5_DIR=/opt/homebrew/opt/hdf5"
Ref: https://github.com/h5py/h5py/issues/2035#issuecomment-1028226141
This works for me:
Install brew (https://brew.sh/)
brew install hdf5
export HDF5_DIR=$(brew --prefix hdf5) (as #sgt pepper said)
pip install --no-binary=h5py h5py

How can I install torch and torchvision with pip and python 3.8.3 on windows in an virtual environment?

I created a virtual environment for my project and I'm trying to install torch via pip.
pip install torch===1.5.1 torchvision===0.6.1 -f https://download.pytorch.org/whl/torch_stable.html
This gives me the error -
ERROR: Could not find a version that satisfies the requirement torch===1.5.1 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch===1.5.1
Some solutions recommend the use of conda, is it necessary? Can I not do it through just pip
You can try to install directly from the wheels files:
pip install https://download.pytorch.org/whl/cu102/torch-1.5.1-cp36-cp36m-win_amd64.whl
pip install https://download.pytorch.org/whl/cu102/torchvision-0.6.1-cp36-cp36m-win_amd64.whl

How do I uninstall xgboost python package?

I have built and installed XGBoost on my system (Ubuntu 16.04) following the provided instructions. Specifically, I have installed it running
python3 setup.py install --user
in its python-package directory.
How can I now uninstall it?
When I try with pip3 I get:
-> pip3 uninstall xgboost
Not uninstalling xgboost at /home/fanta/.local/lib/python3.5/site-packages/xgboost-0.7-py3.5.egg, outside environment /home/fanta/.local/python3.5
I am using virtualenv under Ubuntu 16.04.
Packages installed manually with python setup.py install shouldn't be uninstalled with pip uninstall. You have to remove files and directories yourself. Remove /home/fanta/.local/lib/python3.5/site-packages/xgboost-0.7-py3.5.egg.
Next time you could install things with pip install . in the source code directory.

Tensorflow installation on Windows 10, error 'Not a supported wheel on this platform'

This question is for a Windows 10 laptop. I'm currently trying to install tensorflow, however, when I run:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl
I get the following error:
tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl is not a supported wheel on this platform.
I am trying to install the cpu-version only of tensorflow in an Anaconda 4.3.0 version. I had python 3.6.0 and then I downgraded to 3.5.0, none of them worked.
I also had same problem when I installed anaconda 4.3 version
Here is my solution.
Instead of using Anaconda3 4.3, install Anaconda3 4.2(Anaconda3-4.2.0-Windows-x86_64.exe)
Type on command line(If you are using GPU version)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
Typeon command line(If you are using CPU only)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl
I'm working on win10 with python version=3.5.2, 64 bit
You can use same version of anaconda and execute this command
conda create -n tensorflow python=3.5
activate tensorflow
pip install tensorflow-gpu
It worked for conda 4.0.8
So are you sure you correctly downgraded your python? Run this command on command line pip -V. This should print the pip version and the python version.
Inside your Anaconda environment, try running this:
pip install --upgrade tensorflow
This will do the job. The issue was discussed here also.
Here is the screenshot of how this helped me:
If you have python3 on Windows insatalled, you can use the following command(non GPU):
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl
Worked for me.

Resources