Installing Python Modules in Windows - python

I am new to Python and want to learn it. I am trying to install python27 modules but getting following error. I am using cmd to install these modules. May be I am doing something wrong and not aware of it.

I've just installed matplotlib yesterday, here are the basic procedure:
1 Install python 32bit if you want to make it easier to install matplotlib
2 download the exe installer from matplotlib project page and click install
3 done

Related

Failing to import pyqt5 libraries on a system where both anaconda3 and python 3.5 is installed

I'm new to python trying to figure out some basics. I installed python 3.5 and then, to use jupyter notebook I installed anaconda distrubition. After that, I installed pycharm and started learning python.
After a few weeks, I was able to create a simple project which makes use of pyqt5. My project runs when I run it from pycharm itself, but when I try to run it with "python" command from cmd I get an error, stating that import from pyqt5 has failed. I did some research, and installed pyqt5 using pip, but the problem persists.
So what should I do to run my project without anaconda, using python 3.5?
It seems the anaconda distrubution and python itself were conflicting. Whenever I tried to install a module using pip (like pyqt5), it is installed under anaconda's python so when I try to invoke my own python from console i failed to use those installed modules. Hence there seems to be two option;
Delete all python related stuff from the computer and clean install python only - no anaconda. (I did this)
Or when installing a module, try using different pip's for the two python distrubutions on our computer. Check this link: Install a module using pip for specific python version

Install Python packages and directories (windows) [duplicate]

This question already has answers here:
How to change the path of Python in Spyder?
(5 answers)
Closed 4 years ago.
I am new to configuring and setting up Python from scratch.
I have installed Anaconda and I plan to use Spyder for python development. I also have a older version of Python installed on the same machine elsewhere.
I needed to get my hands on a package to use in Spyder which I needed to download and install.
I downloaded and installed pip directly from the website and then I used this in the command line of the older python install to obtain the package I required.
However I don't understand how I go about making this available to Spyder. I believe it works on a folder structure within it's own directory and I am unsure how to change this to get the package I have already downloaded.
I thought I might be able to copy it across, or point it at the directory where the package was downloaded to but I cannot work out how to do this.
I also tried using pip from within Spyder to work but it cannot find it.
Can you please let me know what I need to check?
from the command line can you use pip? Btw I believe python 3 comes with pip included anyway you need to make sure it's in your path
Find pip.exe on your computer, then add its folder (for example, C:\Python27\Scripts) to your path (Start / Edit environment variables). Now you should be able to run pip from the command line. Try installing a package:
pip install httpie
Try to:
Open Anaconda Prompt and then do: pip install whatever - to install wheels
If you want to install spyder the open Anaconda Navigator - and you should be in the home tab - then highlat spyder and press install - thats all.
There are other ways but within spyder ipython console you can install package like.
In [1]: import pip
In [2]: pip.main(['install', 'module-name'])

Matplotlib installation for python 3.6. and windows 8

I do not understand exactly what I should do to install Matplotlib. I read a lot of posts but I do not have so much of fluent knowledge in programming so basically all of this that i read is quite confusing. Does anyone know what exactly should be done when having Python 3.6., visual code studio and Windows 8 to install Matplotlib?
A way that is simple using the original python from python.org with PATH installed is to use pip. You can check by opening cmd and entering python. If it is not a recognised command then you will have to reinstall python but make sure to tick the box at the start to enable PATH. once this is done you can install packages such as numpy and matplotlib.
In cmd type pip install Then the package you want to install from the PyPI website and using the EXACT name in the url before the version number. It should be like: /PACKAGE/VERSION.
eg. for matplotlib the url is /matplotlib/VERSION, so the name would be matplotlib. To install the latest version pip install matplotlib
If for some reason you want to uninstall a package you would do: pip uninstall PACKAGE. To install a specific version use pip install PACKAGE==VERSION where VERSION is the exact version name in the url. For full documentation visit Packaging Help.
Visual code studio is not necessary in this situation. This question is too broad and asking for a recommendation on software. Because of this, I went with the original python installation way and not any 3rd party software.

Downloading, Installing, Importing libraries in Spyder for Windows 10

I am trying to run PyEphem on Spyder.
I am extremely new to Python and libraries in general.
Currently it just says that I'm running Spyder in Python 2.7.
1) I would like to run the most up to date version of Python via Spyder and then import or install Pyephem (I'm still unclear on whether I have to install the library first or not), how would I do this? I look online but its very confusing because I don't know what I need to download when I'm presented with a list of links.
2) I would also like to see an explanation of how to properly download a libary like pyephem to be incorporated into use within spyder by typing import spyder.
3) I keep reading that I need pip, but I installed the latest version of Python from the website, ran the IDLE, and type 'pip install pyephem,' as directed, but it says 'install' is invalid syntax. Then when I read that I need to type 'python -m pip install -U pip' to update pip, that is invalid syntax too
I just realized over the past 30 minutes that I'm going to need to familiarize myself with how I download and then install and then import a library for use in Spyder, or some other program that I don't know of that may be better.

Python - pip install pandas, not working

I am trying to install pandas via pip install pandas but when I do, I get the error:
Command python setup.py egg_info failed with error code 1 in
c:\users[username]\appdata\local\temp\pip_build_[username]\pandas
I followed the answer given here and installed ez_setup.py without incident, but still get the error when doing pip install pandas.
Thanks for any help, if I can provide more information please let me know.
The easiest way to install pandas and its dependencies on Windows is to download the relevant packages from Christoph Gohlke's Python Extension Packages for Windows repository. You'll find the files for pandas here as well as a list of other required dependencies.
On Linux (Debian / Ubuntu varieties), when NOT installing inside a virtual environment, but in the main system, I find it best to just use the Synaptic Package Manager (because even the --user switch seems to fail when trying to install pandas without sudo). Search for pandas inside Synaptic PM. There's varieties for python 2 and 3.
However, on linux, I have generally found the cleanest, easiest, and overall safest approach to be creating virtual environments and then use pip install <package name> inside the virtual environment. I believe this would be best on Windows too.
I installed Pandas package following procedure listed after the following disclaimer section:
Disclaimer:
- I don't consider myself a computer expert so follow the instructions at your own risk.
- My procedure worked on my windows computer
- My windows computer has python 2.7 installed from python.org
- My python GUI is IDLE
- I don't recall installing pip, it is possible that it installs at the time of installing python 2.7 from python.org (not sure)
- The directory in which my pip.exe is located is under C:\Python27\Scripts
Procedure:
Open a command window for the directory under which you have pip.exe, (in my case is Scripts). The prompt looks like this in my case: C:\Python27\Scripts>
At the prompt type pip install pandas. The prompt looks like this in my case: C:\Python27\Scripts>pip install pandas
Press ENTER key. You should see message: "Collecting pandas" being displayed in the command window.
Once the system completes collecting pandas, you should see message "Successfully installed pandas-0.22.0" , or similar depending on version collected.
Picture shows steps 1 -4 as shown in my computer command window.collecting_pandas

Categories

Resources