It seems that there is a high demand for masochists who run Python on Windows, so I updated it http://qiita.com/mojaie/items/995661f7467ffdb40331
Recently I'm using Python3, so I'm writing on the premise of 3, but I think that you can probably build an environment with 2 in the same way.
Download and install the latest version of 32bit. At the time of writing, it is version 3.4.3. It is the place to install, but somehow it is C: // Program Files (x86) / Python34. https://www.python.org/downloads/
From the Windows Control Panel System → Environment Variables Add the Python installation folder to the end of the system environment variable PATH.
C:Hogehoge;C:Fuga Fuga;C:¥Program Files (x86)¥Python34
Open a command prompt and confirm that the addition of environment variables is reflected. You can now run Python from the command line. ʻExit ()` when exiting.
> echo %PATH%
C:Hogehoge;C:Fuga Fuga;C:¥Program Files (x86)¥Python34
> python
>>> print("Hello, world.")
Hello, world.
>>> exit()
>
Open a command prompt with ** administrator privileges ** (right-click the command prompt icon and you will see Run with administrator privileges).
Install numpy.
However, I get angry and the installation fails. You will be asked to install VC ++, but ignore it and download and install it for Windows from the official website of numpy. It's a name like win32-superpack.
http://sourceforge.net/projects/numpy/
The same is true for SciPy, please download superpack from the official website. I don't use SciPy, so I'll omit it.
Install other necessary items with pip as appropriate.
> python -m pip install pandas
> python -m pip install matplotlib
> python -m pip install networkx
> python -m pip install pyyaml
> python -m pip install xlsxwriter
> python -m pip install pyside
> python -m pip install tornado
Check what was installed with pip.
> python -m pip list
decorator (4.0.2)
matplotlib (1.4.3)
numpy (1.9.2)
pandas (0.16.2)
pip (7.1.0)
pyparsing (2.0.3)
PySide (1.2.2)
python-dateutil (2.4.2)
pytz (2015.4)
PyYAML (3.11)
setuptools (12.0.5)
six (1.9.0)
tornado (4.2.1)
XlsxWriter (0.7.3)
networkx gets angry during installation, but it seems that it has been installed. pyside will give an error if you do not have administrator privileges at the command prompt. Packages that include the C library are often useless with pip, so I think it may be easier for those that have an installer. Spyder or Conda may be easier. Always keep in mind that you have the option of throwing away Windows and buying a Mac.
Put PYTHONPATH in your Python project folder.
From the Windows Control Panel System → Environment Variables Create a new PYTHONPATH in the system environment variable and enter the location of your project folder. Make sure you have a pass.
> echo %PYTHONPATH%
C:\ My project folder
You can now import the modules in your project folder.
> python
>>> import myproject
>>>
If you want to run the script, go to the project folder with cd% PYTHONPATH%.
> cd %PYTHONPATH%
> python myscript.py
Execution result
Recommended Posts