I am pretty new to python and programming , all self taught. I started a new position late last year requiring me to create and maintain large scientific data sets. A big hurdle was learning to install the pyhdf and netcdf4 modules for 64 bit python 2.7 on windows. Here is how to do that.
NEW CONDENSED VERSION ----- JUNE 2016
I have learned more since I wrote this question. Anaconda makes everything except pyhdf (to my knowledge) easier.
1. Anaconda
Download Anaconda 2.7 windows 64 bit from here! and install at C:\Anaconda
2. Numpy
conda update numpy
3. PIP
conda update pip
4. Pyhdf
Download pyhdf python 2.7 64 bit from here!
pip install C:\Users\username\Downloads\pyhdf_file
5. Netcdf
conda update netcdf4
=========================================================================
=========================================================================
OLD METHOD ----- OCTOBER 2014
1. Anaconda
Download Anaconda 2.7 windows 64 bit from here! and install at C:\Anaconda
2. Numpy
In command prompt. You could also use the below method to pip install numpy.
conda install numpy
3. PIP
I used the directions found here!. They are also found below.
Download ez_setup.py and then run:
python ez_setup.py
Then download get-pip.py and run:
python get-pip.py
upgrade installed setuptools by pip:
pip install setuptools --upgrade
4. Pyhdf
Download pyhdf python 2.7 64 bit from here!
pip install C:\Users\username\Downloads\pyhdf_file
5. Netcdf
Download netcdf4 python 2.7 64 bit from here!
pip install C:\Users\username\Downloads\netcdf4_file
Related
I'm trying to install Pytorch with Windows and I'm using the commands of the official site
https://pytorch.org/get-started/locally/
pip3 install torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html
This is the command if I choose Windows, Cuda 10.0, and Python 3.7
But if I run this I get the error message:
ERROR: Could not find a version that satisfies the requirement torch==1.2.0 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch==1.2.0
So why does this happen?
My pip is version 19.2 and I am in a newly installed python 3.7 environment
I tried multiple solutions and it wasn't working on Windows 10 until I tried this:
pip install torch==1.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
If you want your GPU enabled then remove the "+CPU":
pip install torch==1.5.0 -f https://download.pytorch.org/whl/torch_stable.html
The most likely reason for Your issue is a 32-bit installation of python, while the torch libraries rely on having a 64-bit version. I had exactly the same issue.
Just start python from command line and observe
C:\Users\marci>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
My installation now shows 64 bits. If Yours shows 32, then install 64-bit python. I used this link: Official python 64-bit Windows installer
So you have Cuda 10 installed? If you do, try this:
pip3 install https://download.pytorch.org/whl/cu100/torch-1.2.0-cp37-cp37m-win_amd64.whl
followed by:
pip3 install torchvision
To check if it was installed properly, type this into your command line:
python
followed by:
from __future__ import print_function
import torch
x = torch.rand(5, 3)
print(x)
If you get this output:
tensor([[0.3380, 0.3845, 0.3217],
[0.8337, 0.9050, 0.2650],
[0.2979, 0.7141, 0.9069],
[0.1449, 0.1132, 0.1375],
[0.4675, 0.3947, 0.1426]])
PyTorch was installed correctly!
I had the same issue, and what I noticed is that I was using Python 3.8.1 and the latest PyTorch was for Python 3.7.
I uninstalled Python 3.8.1 and installed 3.7.6 and voila, it worked!
Not sure if this is your case, but it helped me.
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
Please use this, worked out for me.
Try installing via .whl file from Christoph Gohlke's repo at this link: https://www.lfd.uci.edu/~gohlke/pythonlibs/
Make sure you get the right one for your python version (cp37 at the bottom).
Navigate to the file or save it to your working directory, then use
pip3 install path-to-file.whl
Link to .whl file on page
The most likely reason for Your issue is a 32-bit installation of python, while the torch libraries rely on having a 64-bit version. I had exactly the same issue.
Just start python from command line and observe
C:\Users\marci>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
My installation now shows 64 bits. If Yours shows 32, then install 64-bit python. I used this link: Official python 64-bit Windows installer
it is the best answer
Go here https://pytorch.org/get-started/previous-versions/ and find the appropriate command for the version you want.
But first it is best to create an virtual environment with the right version of python
conda create -n you_env_name python=?.?.?
Then activate the environment
conda activate your_env_name
try the following in your IDE command prompt then restart the IDE:
conda install pytorch -c pytorch
it's because your python version is 32bit while you're trying to download a 64bit version of Pytorch, navigate to pytorch_whl_page and choose an appreciate version of Pytorch
or reinstall python from the official Python page to a 64bit version
You will find the correct code to run on the PyTorch website.
There, you can choose your OS, platform, pip, conda and other customisation.
For example, the code to install the PyTorch package on Windows using pip and the CUDA 10.2 platform is (without the quotes:
"pip3 install torch==1.9.0+cu102 torchvision==0.10.0+cu102 torchaudio===0.9.0 -f https://download.pytorch.org/whl/torch_stable.html"
Just downgrade your python version. I was using Python 3.10 then I uninstalled that and reinstalled python 3.7. It started working for me
PyTorch is now torch.
import torch
print(help("torch"))
For around a week or two now, I've been trying to get certain packages working, and I've tried almost everything.
I've tried using pip, and pip3 when installing packages
I've tried re-installing python 32 bit and 64 bit
I've tried different versions of python
I've tried different versions of the packages
Some of the things I've tried to install are things like pygame and opengl
Please help me with this
This official link has information regarding installation of packages
https://packaging.python.org/tutorials/installing-packages/#use-pip-for-installing
Steps:
1. Download `get-pip.py` file from https://bootstrap.pypa.io/get-pip.py
2. Install pip - python get-pip.py
3. Then install any packages using pip - pip install <package>
This is my first question on this site so I hope I format this correctly. I also am very new to programming so bear with my lack of knowledge, thank you!
I'm trying to install pyHook like so and I keep getting this error message:
C:\Python27>py -2.7 -m pip install pyHook-1.5.1-cp27-cp27M-win_amd64.whl
pyHook-1.5.1-cp27-cp27M-win_amd64.whl is not a supported wheel on this platform.
I have python 2.7.14 as you can see from below:
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit
(AMD64)] on win32
Just in case, I tried updating pip and It said it was up to date. I also tried install this version of the .whl and I get the same error:
C:\Python27>py -2.7 -m pip install pyHook-1.5.1-cp27-cp27m-win32.whl
pyHook-1.5.1-cp27-cp27m-win32.whl is not a supported wheel on this platform.
From reading online I believe cp27 indicates its for python 2.7 and to be safe I tried the 64 bit and 32 bit files, but nothing seems to work. If anyone could offer up any solutions or advice, it would be greatly appreciated!
I installed Python 2.7, then pyHook and was able to get it working following these exact steps.
Note, I was using Anaconda to create the Python 2.7 environment and Windows 10 is my OS.
conda create -n python27 python=2.7 This created a new conda environment with python 2.7.14.
activate python27
python -m pip install --upgrade pip This installed pip version 10.0.0
Downloaded pyHook from the unofficial windows binaries.
Specifically: pyHook-1.5.1-cp27-cp27m-win_amd64.whl
Navigated to downloads folder in command prompt
pip install pyHook-1.5.1-cp27-cp27m-win_amd64.whl
That installed it properly with no error messages. Hope that helps. My guess is that the new pip version fixes it, or there is a problem with how you are installing Python 2.7, so try Anaconda (or miniconda if you want to keep it light)
I was also able to import it with no problem after these steps.
Many binaries depend on numpy-1.13+mkl and the Microsoft Visual C++ 2008 (x64, x86, and SP1 for CPython 2.7), Visual C++ 2010 (x64, x86, for CPython 3.4), or the Visual C++ 2017 (x64 or x86 for CPython 3.5, 3.6, and 3.7) redistributable packages.
Install numpy+mkl before other packages that depend on it.
I have Microsoft Visual C++ 2008.I just do this,
python -m pip install numpy-1.13.3+mkl-cp27-cp27m-win_amd64.whl
python -m pip install pyHook-1.5.1-cp27-cp27m-win_amd64.whl
then it work.
I tried installing numpy 1.11.2 on my windows 10 64 bit pc. but I have problem importing it in python(version 2.7 64 bit), what steps should i follow. and if a wheel has to be installed then which verison and how do i install it please?
You can use the Anaconda distribution which comes with many scientific packages preinstalled from here
I am sure you tried pip install numpy , an alternative would be to download numpy wheel from here http://www.lfd.uci.edu/~gohlke/pythonlibs/ and do pip install wheel.
I was having a similar problem installing Numpy for python 2.7. Here is what I ended up doing:
py -2 -mpip install numpy
This tells all intrested parties that you really want to install Numpy on python 2.7. It will warn you that you need to upgrade as python 2.7 has come to its end of life.
I'm trying to install tensorflow on windows. I have python3 (3.5.2) and pip3 (9.0.1):
pip3 install --upgrade tensorflow
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
Found this issue here as well: tensorflow not found in pip
but none of the solutions worked for me. Any ideas?
Try the following at a Python command prompt:
import platform
platform.architecture()[0]
It should display '64bit'
Just having an x86 version of Python isn't enough.
I had the same problem. Thought I had a 64 bit installation but it turned out to be 32 bit.
BTW. it will also work fine with the Conda Python 3.6 distribution. And indeed use the distro from the Gohlke page as indicated by Guillaume Jacquenot.
You can download binary wheel from Christoph Gohlke's webpage
Once downloaded, you can run pip install tensorflow‑1.0.1‑cp35‑cp35m‑win_amd64.whl for Python 3.5 64 bit
This is what worked for me.
Currently, Tensorflow only works with 64-bit windows, not 32-bit.
So, you could create a new 64-bit environment and install tensorflow in it:
set CONDA_FORCE_32BIT=
conda create --name name_of_your_created_environment python=3.5
activate name_of_your_created_environment
conda install -c conda-forge tensorflow
CONDA_FORCE_32BIT=1 sets to a 32-bit environment whilst CONDA_FORCE_32BIT= sets to a 64-bit environment.
I have written a blog over this topic, you might find it interesting and helpful:
Mainly issue that people face is they install 32 bit python:
Solution as follows
Install Python 3.6 (Note down installation path, or simply custom install to C:\Python36) in your system - Make sure that Python is of "x64" architecture.
To check your python architecture
Import platform
platform.architecture()[0]
Link to download Python36 with 64 bit architecture : https://www.python.org/ftp/python/3.6.2/python-3.6.2-amd64.exe
For more info you can follow the this link
https://tensorflowwindows.quora.com/
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.0-py3-none-any.whl
try this one under your python environment
Just follow 3 steps:
Install python 3.5.x version (64bit MUST)
Install pip
pip install tensorflow==2.0.0-alpha0
And you are good to go.
Found this after struggling for days
You need to install Python 3.7 to download end version of Tensorflow ->2.3 and some packages:
visual studio tools C++
cuda_10.1.105_418.96_win10
After spending hours I am able to fix TensorFlow installation issue on Windows. here is the summary https://stackoverflow.com/a/50475864/1996802