Conda doesn't recognize package updated by PIP and link error(337) - pip

Recently I use conda update --all to update all packages. But there is an error:
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::wheel-0.30.0-py_1'.
So I update wheel by pip. After that I use conda update --all again while the error still remains. It looks like that conda doesn't know that the version of wheel has been 0.30 so that there is no need to install it.

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

Installing mplsoccer into conda issue

I can install mplsoccer into my command prompt using pip, but I am unable to install it into conda. I get the error message:
Image shows error message inside conda
I have been to anaconda.org, but I am unable to find a solution
I'm the author of mplsoccer. It is now available in conda-forge: conda install -c conda-forge mplsoccer.

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

ModuleNotFoundError: No module named 'telegram' after pip install

After running pip install python-telegram-bot, I'm getting this error that the 'telegram' module is not found.
Under pip list I see that my python-telegram-bot package is installed version 13.2
Is anyone else getting this error?
Try another way to install it
first remove it
pip3 uninstall python-telegram-bot
Clone and install
git clone https://github.com/python-telegram-bot/python-telegram-bot
cd python-telegram-bot
python3 setup.py install
pip3 install python-telegram-bot
It should work
I also had this problem - for me the issue was that I was trying to run my code from a module called telegram.py. Newbie mistake I know...
pip3 install python-telegram-bot
Install it in outside of virutal environment in terminal. Also unintall telegram. python-telegram-bot is sufficient for Telegram bot. In my case it resolved my issue.
Do 1-2 via terminal and 4 on your IDE:
Install pip install telegram Install pip install python-telegram-bot
If you are using a virtual environment, make sure it is activated
Lastly, **import from telegram.ext import ***

Basemap install on mac without fink (I tried everything I can google)

I am a Python Noob. (Using Mac OS 10.12 & Python 3.7)
I'm trying to use mpl_toolkits.basemap
to execute the code
from mpl_toolkits.basemap import Basemap
I googled the way to get matplotlib and successfully installed it.
However, while it's possible to run "from mpl_toolkits.basemap import Basemap" in terminal on mac,
it fails to be loaded if I run the command within IDLE.
Then, I googled to figure out the issue and got the hint that
it could be resolved if I install Basemap properly.
To install Basemap, I think I need to go with "FINK".
However, Fink is only available up to 10.5 OS while mine is 10.12.
And FINK website says do not update OS before upgrading FINK.
However, it's too late for me.
Cause I updated my OS longtime ago and recently I started to learn Python Using Mac.
So I guess, if there is a way to install Basemap not using apt-get,
(the codes below is from "Python basemap module impossible to import")
sudo apt-get install libgeos-3.5.0
sudo apt-get install libgeos-dev
sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
I think my issue could be cleared.
Since I'm really really noob, I'm not sure this is the reason for my failing in "from mpl_toolkits.basemap import Basemap".
What I tried so far is
1) brew install basemap
with the error of
Error: No available formula with the name "basemap"
==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
2) pip install basemap
with the error of
Requirement already satisfied
3) sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
with the error of
Command "python setup.py egg_info" failed with error code 1 in
/private/tmp/pip-install-lux494o4/pyproj/
4) conda install basemap
with the following message of
All requested packages already installed.
5) conda install -c conda-forge basemap
with the following message
Preparing transaction: done Verifying transaction: done Executing
transaction: done
Can anyone help to install basemap properly so that I could run
"from mpl_toolkits.basemap import Basemap"
in my IDLe?
My IDLE Sheel keeps saying
Traceback (most recent call last): File "", line 1, in
from mpl_toolkits.basemap import Basemap ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
while my terminal doesn't have problem with running the code.
Appreciate it in advance.
any luck? I spent the day battling this as well. I had the most success when I tried downloading an older version of basemap.
I was using python 2.7 and this worked okay sudo -H pip2 install https://github.com/matplotlib/basemap/archive/v1.1.0.tar.gz
For python 3 try replacing pip2 with pip3 or pip.
Ran into this myself today my solution:
install libgeos on mac
brew install geos
then as you suggested use pip to install mpl_tools:
pip3 install -q https://github.com/matplotlib/basemap/archive/master.zip
This also may help:
missing libgeos_c.so on OSX
Firstly, I suggest you to set Anaconda up. Then follow below steps;
Create a new environment in anaconda.
Install Jupyter Notebook and launch it. If it works, turn it off.
Change your anaconda environment in your terminal.
Try installation commands below;
conda install ...
conda install forge ...
pip install ...

Resources