Numpy failure while installing python(3.6.6) module pandas-0.24.2. on AIX 7.1.0.0 powerpc - pandas

Aix ---> 7.1.0.0 (64 Bit)
Python --> 3.6.6
Not able to install module pandas-0.24.2 ,
It is failing while trying to import numpy with the below error message,
ImportError: 0509-022 Cannot load module $PYTHON_HOME/lib64/python3.6/site-packages/numpy-1.16.2-py3.6-aix-7.1.egg/numpy/core/_multiarray_umath.so.
Have tried compiling the numpy module from the package source, still it didn't work....
https://stackoverflow.com/questions/31704639/compiling-numpy-for-python3-for-aix-works-but-import-fails#32736358
https://github.com/numpy/numpy/issues/12396
https://github.com/numpy/numpy/issues/11317
https://github.com/numpy/numpy/issues/4723
ImportError: 0509-022 Cannot load module $PYTHON_HOME/lib64/python3.6/site-packages/numpy-1.16.2-py3.6-aix-7.1.egg/numpy/core/_multiarray_umath.so.
0509-026 System error: Cannot run a file that does not have a valid format

try :
pip uninstall -y numpy
pip uninstall -y setuptools
pip install setuptools
pip install numpy

Related

Can't install lxml on pip

I can't install lxml on pip or pip3
I tried run the code on python3.11
import pandas as pd
data = pd.read_html("https://zh.wikipedia.org/zh-hans/%E6%81%92%E7%94%9F%E6%8C%87%E6%95%B8")
It occurred a Import Error.
"ImportError: lxml not found, please install it"
So I tried to install the lxml. "pip install lxml"
However, it cannot be install.
** 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.
╰─> lxml
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.**
And then, I had download the lxml-4.9.9-pp38-....whl
and entered "pip install c:/......." and it said whl is not a supported wheel on this platform.
Could someone do me a favor?

How can I fix the error "Could not find a version that satisfies the requirement torch" when trying to install PyTorch using pip?

I tried importing 'PyTorch' as 'torch' as most recent, but visual studios/cmd cannot locate nor download the package.
# Import the required modules import torch import torch.nn as nn import torch.nn.functional as F
same goes with
import tensorflow as tk
I wasn't able to download the package:
not able to find the file.
I tried both:
pip install --upgrade pip
and:
pip install torch==1.0.2
I tried all types such the basic pip install [package] to connecting the wsl.file through path
Installing older torch needs --find-index flag to pip, like torch 1.5 with cuda 10.1:
pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
Reference:
https://pytorch.org/get-started/previous-versions/

Cannot pip udate numpy

I want to update numpy from 1.19.1 to 1.19.2. So I did the following command:
pip install --upgrade numpy
However, I received the following error message:
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/userdata/data-dlin/.conda/envs/mybase/lib/python3.7/site-packages/numpy-1.19.1.dist-info/RECORD'
I went to the directory and found the RECORD file was indeed missing. How do I fix the error?
Uninstalling numpy (pip uninstall numpy), then deleting the entire folder
(python environment)/lib/site-packages/numpy-1.19.X.dist-info
And reinstalling numpy (pip install numpy) fixed it for me.

Cant import keras

I ran the following on my Anaconda command prompt for python 3.6:
pip install keras
Next, typing the following on Spyder:
import keras
The above gives me an error:
No module named 'tensorflow'
Tring to do pip install tensorflow on the Anaconda command prompt gives me the follwing error:
No matching distribution found for tensorflow
To install a module into anaconda, use
$ conda install tensorflow
The command that you ran
$ pip install tensorflow
will not install it inside the anaconda virtualenv for python.
If you try
$ python
>>> import keras
This will work after pip install tensorflow. However, use conda package manager to install modules to anaconda.

Install numpy on python3.3 - Install pip for python3

For python 3.2 I used sudo apt-get install python3.2-numpy.It worked.
What to do for python3.3? Nothing I could think of works. Same goes for scipy, etc.
Thanks.
Edit: this is how it looks like
radu#sunlit-inspired:~$ python3
Python 3.3.2 (default, Jul 3 2013, 10:17:40)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
In the solution below I used python3.4 as binary, but it's safe to use with any version or binary of python. it works fine on windows too (except the downloading pip with wget obviously but just save the file locally and run it with python).
This is great if you have multiple versions of python installed, so you can manage external libraries per python version.
So first, I'd recommend get-pip.py, it's great to install pip:
wget https://bootstrap.pypa.io/get-pip.py
Then you need to install pip for your version of python, I have python3.4 so for me this is the command:
python3.4 get-pip.py
Now pip is installed for this version and in order to get libraries for python3.4 I have to use pip like this:
python3.4 -m pip
So if I want to install numpy I'd use :
python3.4 -m pip install numpy
Note that numpy is quite the heavy library. I thought my system was hanging and failing.
But using the verbose option, you can see that the system is fine :
python3.4 -m pip install numpy -v
This may tell you that you lack python.h but you can easily get it :
On RHEL (Red hat, CentOS, Fedora) it would be something like this:
yum install python34-devel
On debian-like (Debian, Ubuntu, Kali, ...) :
apt-get install python34-dev
Then rerun this :
python3.4 -m pip install numpy -v
From the terminal run:
sudo apt-get install python3-numpy
This package contains Numpy for Python 3.
For scipy:
sudo apt-get install python3-scipy
For for plotting graphs use pylab:
sudo apt-get install python3-matplotlib
The normal way to install Python libraries is with pip. Your way of installing it for Python 3.2 works because it's the system Python, and that's the way to install things for system-provided Pythons on Debian-based systems.
If your Python 3.3 is system-provided, you should probably use a similar command. Otherwise you should probably use pip.
I took my Python 3.3 installation, created a virtualenv and run pip install in it, and that seems to have worked as expected:
$ virtualenv-3.3 testenv
$ cd testenv
$ bin/pip install numpy
blablabl
$ bin/python3
Python 3.3.2 (default, Jun 17 2013, 17:49:21)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
I'm on Ubuntu 15.04. This seemed to work:
$ sudo pip3 install numpy
On RHEL this worked:
$ sudo python3 -m pip install numpy
My issue was the failure to import numpy into my python files. I was receiving the "ModuleNotFoundError: No module named 'numpy'". I ran into the same issue and I was not referencing python3 on the installation of numpy. I inputted the following into my terminal for OSX and my problems were solved:
python3 -m pip install numpy
On fedora/rhel/centos you need to
sudo yum install -y python3-devel
before
mkvirtualenv -p /usr/bin/python3.3 test-3.3
pip install numpy
otherwise you'll get
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.