downloading matplotlib python 2.7.1 windows 8 - python

I want to use pyPlot, therefore install matplotlib.
When I downloaded numpy, I realized I already have pip on this python version (I have windows 8, using 64-bit)..
Now if I want to install matplotlib to my python, can I do it using some kind of command from the command line or do I need to install something first and then navigate to setup.py Directory and run:
python setup.py
when I try:
pip install matplotlib
or even installing it and using
pip install matplotlib-1.5.0-cp35-none-win_amd64.whl
it gives me error:
ValueError: failed to parse CPython sys.version: 2.7.9 |CUSTOM| (default,
Jul1 2015 03:41:50 ) [ MSC vs. 1500 64 bit (AMD 64)]
location of my python is:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 2.7
ANY HELP..?

Why not installing it with pip then?
pip install matplotlib

You either install it with pip: pip install matplotlib or download the binary from windows.

Related

Cannot seem to download SimpleElastix: file.whl wheel not recognized/import not recognized

I'm trying to install SimpleElastix for python. As far as I can tell, you can either download a whl file from https://simpleelastix.github.io/#download
or simply pip install as shown here: https://pypi.org/project/SimpleITK-SimpleElastix/
I first tried downloading it and am trying to install SimpleITK-0.9.1rc1.dev163-cp34-cp34m-win_amd64.whl that I have saved to drive.
I am using the following (pip has been updated):
(hids3) C:\Windows\system32>python --version
Python 3.8.0
(hids3) C:\Windows\system32>pip --version
pip 22.0.4 from C:\Users\kated\anaconda3\envs\hids3\lib\site-packages\pip (python 3.8)
I try to run pip install SimpleITK-0.9.1rc1.dev163-cp34-cp34m-win_amd64.whl
and get the following error:
ERROR: SimpleITK-0.9.1rc1.dev163-cp34-cp34m-win_amd64.whl is not a supported wheel on this platform.
According to Error "filename.whl is not a supported wheel on this platform" , this could be caused by a downloading the .whl file for a wrong python version. I would expect python 3.8 to support a CPython 3.4 version or am I wrong for assuming this?
Alternative way to download SimpleElastix: https://pypi.org/project/SimpleITK-SimpleElastix/
I also tried running
pip install --user SimpleITK-SImpleElastix
in the terminal, which worked, but when I run
import SimpleITK as sitk
sitk.Elastix()
I get
AttributeError: module 'SimpleITK' has no attribute 'Elastix'
Anyone have any idea what I'm doing wrong in either case?

ERROR: Failed building wheel for numpy , ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

I`m using python poetry(https://python-poetry.org/) for dependency management in my project.
Though when I`m running poetry install, its giving me below error.
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
I`m having python 3.9 installed in my laptop.
I installed numpy 1.21.5 using pip install numpy, I even tried to down version it to 1.19.5.
Though I`m getting the same error.
I found out many people are getting ERROR: Failed building wheel for numpy this error in python 3.10, they solved it by down versioning python to 3.9, though that didnt working for me.
I solved it by doing the following steps:-
I updated the pyproject.toml(This file contains all the library/dependency/dev dependency)with the numpy version that I installed using pip install numpy command.
Run poetry lock to update poetry.lock file(contains details information about the library)
Run poetry install again, & it should work fine.
If you are having any problems, you can comment.
I`ll try to answer it.
I had this trying to install numpy with PyPy on macOS.
I solved the issue by first running brew doctor, which showed that my Command Line Tools (XCode) were outdated. Then I just followed the instructions to update them:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
This solved the issue.
My configuration:
macOS 12.2.1 Monterey
> python --version
Python 3.8.12 (9ef55f6fc369, Oct 25 2021, 05:10:01)
[PyPy 7.3.7 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]
Numpy error solved
Error: failed to build wheels for numpy which is required to install project.tmol
This error cause due to outdated numpy version simply run this command
MATHLAB = "m" pip install numpy
`
My python version:
Python -V=3.9
It doesn't works in se case but most of the time works.
If you are working in venvthen try to install numpy in venv.
Then run your code it will be working
Fine.

Trying to install a program and got an error asking a Python version that is already installed, and also a pip error

As the title says, I am trying to install a program that has a couple of dependecies that demand a specific Python version (>= 3.7). I do not have admin rights, so I can't use sudo. The Python version installed is 2.7. Because of that, I used virtualenv to install and execute Python 3.9.5.
I executed venv, and checked the Python and pip versions:
which python
/home/honda/venv_python-3.9.5/bin/python
which pip
/home/honda/venv_python-3.9.5/bin/pip
I even checked the version using:
python
Python 3.9.5 (default, May 10 2021, 13:50:25)
Which, as I understand, means that I have the correct Python/pip versions.
However, when I try to install the program, I get this:
./install.sh ../Programs/
Installing darwin binary...
Installing oma...
Installing libraries...
creating virtualenv for hog_bottom_up
Collecting numpy (from -r ../Programs//OMA/OMA.2.4.2/hog_bottom_up/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/f3/1f/fe9459e39335e7d0e372b5e5dcd60f4381d3d1b42f0b9c8222102ff29ded/numpy-1.20.3.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-3_2_atp3/numpy/setup.py", line 30, in <module>
raise RuntimeError("Python version >= 3.7 required.")
RuntimeError: Python version >= 3.7 required.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3_2_atp3/numpy/
You are using pip version 8.1.1, however version 21.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Cannot install python dependencies for hog-bottom-up inference algorithm
cannot create virtual environment for hog_bottom_up
To be honest, I don't know what is happening here. Is there something I am missing? I am not experienced in using virtualenv (I previously used another computer, one that I could use sudo, so I never had any problems like this, and I did install this same program there.)
Is there anything I can try? I guess could reach out to the admin and ask them to install the program for me, but I'd rather not do that yet.
Thank you!

Installing matplotlib using pip in cmd finishes without actually installing

I'm trying to install matplotlib library using pip from cmd (Windows 10), but the installation finishes after the download without actually installing the package. I don't get any error message, it just finishes.
cmd output:
C:\Users\username>pip install matplotlib
Collecting matplotlib
Using cached https://files.pythonhosted.org/packages/1a/c0/69e3f695d7384012e90be1e16570c08953baae00fd98094179ef87c7d5a2/matplotlib-3.1.1-cp37-cp37m-win_amd64.whl
C:\Users\username>
Trying without cached version doesn't help.
C:\Users\username>pip install --no-cache-dir matplotlib
Collecting matplotlib
Downloading https://files.pythonhosted.org/packages/1a/c0/69e3f695d7384012e90be1e16570c08953baae00fd98094179ef87c7d5a2/matplotlib-3.1.1-cp37-cp37m-win_amd64.whl (9.1MB)
100% |████████████████████████████████| 9.1MB 25.5MB/s
C:\Users\username>
I also tried downloading the .whl file and installing manually, same problem.
C:\Users\username\Downloads>pip install matplotlib-3.1.1-cp37-cp37m-win_amd64.whl
Processing c:\users\username\downloads\matplotlib-3.1.1-cp37-cp37m-win_amd64.whl
C:\Users\username\Downloads>
After all this matplotlib doesn't exist as an installed library. Other libraries are being installed and working fine without problems.
C:\Users\username\Downloads>pip show matplotlib
C:\Users\username\Downloads>
C:\Users\username\Downloads>pip show keras
Name: Keras
Version: 2.2.4
Summary: Deep Learning for humans
Home-page: https://github.com/keras-team/keras
Author: Francois Chollet
Author-email: francois.chollet#gmail.com
License: MIT
Location: c:\users\username\appdata\local\programs\python\python37\lib\site-packages
Requires: h5py, numpy, scipy, six, keras-applications, pyyaml, keras-preprocessing
Required-by:
I've done the whole exercise using pip3 also, the results are the same.
I've done this in cmd, powershell, and VSCode's powershell terminal as well, still same result.
Any idea what is happening here and how to solve it?
Note: I've replaced my user name with "username" in the cmd outputs.
Edit: I also tried installing a different version of matplotlib, but still getting the same result.
All I can think of is running this code from command line in the following order (Windows users):
python -m pip install -U pip
python -m pip uninstall matplotlib
This would pop the question: Proceed (y/n)?
y
python -m pip install matplotlib

How to install cvxopt without downgrading mkl and python

Environment:
OS = Windows 10, Python ver = 3.7.0, mkl ver = 2019.0-118, conda ver = 4.5.12. All up to date as of now (2019/1/13).
Issue:
When attempting conda install cvxopt, it prompts at the end:
The following packages will be DOWNGRADED:
mkl: 2019.0-118 --> 2018.0.3-1
python: 3.7.0-hea74fb7_0 --> 3.6.8-h9f7ef89_0
Proceed ([y]/n)? n
I don't want to downgrade either. Actually, when I visit the cvxopt's installation page it states clearly that
Wheels for Windows:
are available for Python 27, 3.4, 3.5, 3.6, and 3.7 (64 bit only)
The suggested installation procedure is a bit complicated, though.
I'm just wondering if there's a simple way (that is, for dummies) such as a one-line command that can install cvxopt without compromising python or mkl.
Thanks.
It's best not to mix conda and pip packages. It looks like conda-forge has the latest version of cvxopt, so simply do:
conda install -c conda-forge cvxopt
You could just try pip3 install cvxopt
I've just tried it and it works on my Windows machine

Categories

Resources