Difference between revisions of "Python Installation"

From OpenCircuits
Jump to navigation Jump to search
Line 57: Line 57:
 
* Usually after an install you can just restart the program, but I have sometimes found that restarting an IDE is necessary.
 
* Usually after an install you can just restart the program, but I have sometimes found that restarting an IDE is necessary.
 
* Repeat with the next import that fails.
 
* Repeat with the next import that fails.
 +
 +
 +
= Anaconda Links =
 +
 +
 +
*'''[http://conda.pydata.org/docs/faq.html#pkg-installation FAQ — Conda documentation ]'''
 +
*'''[https://www.continuum.io/anaconda-overview Anaconda Overview | Continuum ]'''
 +
*'''[http://conda.pydata.org/docs/ Presentations & Blog Posts — Conda documentation ]'''
 +
*'''[http://sjbyrnes.com/python/ Python « Steve Byrnes's Homepage ]'''
 +
*'''[https://pythonhosted.org/spyder/installation.html Installation — Spyder 2.3 documentation ]'''
 +
*'''[https://www.southampton.ac.uk/~fangohr/blog/installation-of-python-spyder-numpy-sympy-scipy-pytest-matplotlib-via-anaconda-2013.html Installation of Python, Spyder, Numpy, Sympy, Scipy, Pytest, Matplotlib via Anaconda (2013) — Computational Modelling Blog ]'''
 +
*'''[https://spyder-ide.blogspot.com/ spyder ]'''
 +
*'''[https://docs.continuum.io/anaconda/faq Anaconda FAQ | Continuum Analytics: Documentation ]'''
 +
*'''[https://docs.continuum.io/anaconda/install Anaconda install | Continuum Analytics: Documentation ]'''
 +
*'''[https://www.continuum.io/downloads Download Anaconda Now! | Continuum ]'''
 +
*'''[https://jupyter.readthedocs.io/en/latest/install.html Installing Jupyter Notebook — Jupyter Documentation 4.1.1 alpha documentation ]'''

Revision as of 15:59, 22 June 2020

Title is a bit misleading as these are not general notes, but notes on how I install and how you might get some of my applications ( see the categoy below on Python Projects 0)

Basic Install

I use the Anaconda installation because it gives a wide range of Python Packages, A Package and Virtual Environment Manager, a very good Python IDE ( Spyder ), IPython, Juypter Notebooks... all in one install.


Maintenance and Additions

From Anaconda Navigator

The second page of Navigator called Environments is a nice way to create, modify and delete Python virtual environments. On the left hand side you can choose your environment, and on the right hand side you can manage packages for the given environment. If that does not entirely work for you, you can just pick your environment on the left and have it drop you to a command line ( terminal ) for that environment. At that command line you can run python, conda, pip, or whatever you want.

Using Conda

I start with Navigator to get to a terminal in the right Python environment then use conda. Conda is pretty much like pip ( conda install something_wonderful ) but different. It is supposedly not full compatible with pip so I only use pip when conda does not work. Sometimes the command are a bit more complicated as: "conda install -c conda-forge spacy" which I use to install spacy.

Using Pip

When conda fails use pip.

Using Setup.py

When pip fails consider setup.py, usually will have a readme file in the package for your guidance... after this there is still google or the author of the software you are using this package for.

Some Packages I use -- Not in the Anaconda Distribution

I always used conda first and if that does not work move on to pip if that does not work perhaps setup.py


Pyperclip

  • Why: For Python to access the system clipboard. Get Copy and Paste working in your applications
  • Install: pip install pyperclip
  • May be used in Clipboard, EasyDB, TwitterDB SmartTerminal

Spacy

HTML

  • Why: For Python to process language into its base words or lemmas
  • This is an old package that I came across and liked, there may be better ones, but this did what I wanted for a couple of my applications. It cannot currently be installed with conda or pip. All the code, which I downloaded and decompressed is in each application where I use it ..../resources/HTML.py-0.04 The install is documented in the readme file, I used "python setup.py install".
  • May be used in EasyDB, TwitterDB
  • Links


Working With Someone Else's Source

So follow their directions. If it is my code this is pretty minimal. I have not started using requirements.txt but will if I get many requests. In any case here is pretty much the last resort method:

  • Run the code.
  • Stop when an import fails. Try to install with conda.... pip.... An unfortunate fact is that the package name for conda/pip is not always exactly like the import name ( but usually is ), so a bit of google may help.
  • Usually after an install you can just restart the program, but I have sometimes found that restarting an IDE is necessary.
  • Repeat with the next import that fails.


Anaconda Links