How to install VPython on Python 3.6 (python distribution)? - python-3.x

I want to get Vpython on Python 3.6(Python Distribution). I couldn't find an option except for anaconda. Please help because I want to process the data coming from Arduino to Python making 3D visualizations.

See VPython's website for install options and how the new VPython differs from the older classic VPython. The new VPython works with python 3.6. The old classic VPython works only with python 2.x.. If you have the old classic VPython on your computer then you might need to uninstall it first. Then install the new VPython version 7 with pip.
pip install VPython
Then launch IDLE or spyder python IDE and try running this simple program:
from VPython import *
box()
You should see a 3d canvas with a box appear in your webb browser.

Related

Pandas install or import in IBM SPSS Statistics Version 26

I have installed the latest version of IBM SPSS Statistics(Version 26) which has pre installed python 3.4 and 2.7. i am trying to use version 3.4 python. i am able to import modules like pip , sys , os etc. i tried pandas the same way. i am unable to do so. getting error no module found. Hence going through our forum and IBM support did the following changes.
received the following error
1) tried pointing the site-packages via
import sys
# Assuming windows and standard python folder here.
sys.path.append(r"D:\Python34\Lib\site-packages")
2) changed the path in the settings of SPSS
3) Tried installing pip in the below folder as suggested in the forum but got message i have already installed the updated version.
C:\Program Files\IBM\SPSS\Statistics\Subscription\Python3
4) following versions of python were installed
have tried what i could. Need your expertise help to fix the same which will help me to install/use modules needed for SPSS. Thanks.
This is going to be painful to explain, I'll do my best.
As far as I can tell, you're on windows. Usually when we need a new package, we just open cmd and type pip install xxx (assume you added python to path when installing it). The reason that this works, is because when you type pip install xxx in cmd, windows recognize pip to be a command because python path is in system variables. Windows know that I can execute pip install with this python path.
However for SPSS python (3.4), that python had a different path in the system. Thus when you only have the 3.7 or 3.8 python in path, windows cannot install package to you 3.4 python, and I'm not sure if you can have more than one python path in system.
In order to fix this, you need to first figure out what's the path to your 3.4 python, then in this page you can follow the instruction to remove your 3.7 or 3.8 python in path, and add your 3.4 path, then you can do pip install xxxx for whatever package you want
I did the same thing with a arcgis python distribution, hope this works for you. If the attached page does not work, just google add python path to windows and look for a instruction that works on you PC
Oh and the reason that you can import pip, sys and some other package but not pandas, is because python is 'battery included', it comes with tons of packages pre-installed for additional functionality, but pandas is not one of them.
Fixed it since my ananconda had version 3.7 .i created virtual environment and installed 2.7 python with anaconda package. Pointed SPSS to the 2.7 folder and was able to import pandas.

How to install graphics in python any version?

I am using Python 27 in windows and I needed to install some modules in it so using pip I installed matplotlib which worked fine but then when I tried installing graphics,it didn't work. I also googled where I found that Graphics can be installed for 3x version. I am using 2x version because I wanted to use Vpython as well which doesn't work for 3x version (atleast I found it is very difficult to use with Python 34). Then I tried using both the Python 27 and 34 and then tried installing modules in Python 34 but since matplotlib is already installed before,I am unable to install for Python 34.Also there is not module in Python 34. I just started using Python and I am having all these problems. Please anyone who could help me with it?
You could try this:
pip install https://raw.githubusercontent.com/jminz/graphics.py/master/graphics-py_installer.tar.gz
This command from official readme: https://github.com/jminz/graphics.py
I don't know what is meant by "Graphics", but as far as VPython is concerned, see the detailed instructions at vpython.org. The old Classic VPython did not work with Python 3. The new VPython 7 works in a Jupyter notebook with any version of Python and outside a Jupyter notebook (for example, using IDLE or Spyder) with Python 3.5.3 or greater.
Also, for VPython questions it's better to post to the VPython forum, where there are many more VPython users who will see your question than if you post to stackoverflow:
https://groups.google.com/forum/?fromgroups&hl=en#!forum/vpython-users
Open Command Prompt and type exaclty what shown in the image
To install the graphics package
pip install graphics.py
https://pypi.org/project/graphics.py/

PyCharm 2017.1, No module named 'kivy'

I could use (troubleshooting)help with getting Kivy imported in PyCharm. I am using:
Anaconda with Python 3 on 64-bit Windows 10 Pro
PyCharm 2017.1
Packages: NumPy, SciPy, BeautifulSoup, Pandas, Scrapy, Pattern, NetworkX, NLTK, scikit-learn, Selenium
I have installed Kivy following the instructions at https://kivy.org/docs/installation/installation-windows.html#installation
As evident from the screen shot, no errors occurred.
Still, when I run "import kivy" from PyCharm I get "ModuleNotFoundError: No module named 'kivy'".
I ran through the installation with someone on the #kivy channel and was assured that kivy is successfully installed.
When I pass import kivy; print(kivy.file) to the interpreter (opened from the CMD command line), I get returned among others:
C:\Users\Steve\Anaconda3\lib\site-packages\kivy\__init__.py
Someone on #kivy suggested I check where PyCharm looks for kivy. How do I figure that out?
I'd appreciate any suggestions to identify the problem / resolve my issue.
Indeed, the installation of Kivy went fine. The problem turned out to be that I had to select the correct (updated) interpreter in the PyCharm settings.

Is it possible to use an Anaconda Python 3 environment together with Pycharm?

My basic problem is that I want to install scipy on a Window's machine for Python 3 and use Pycharm as my development environment.
The suggestion from the Scipy Documentation as well as several StackOverflow posts (Installing NumPy and SciPy on 64-bit Windows (with Pip), Trouble installing SciPy on windows, etc.) is to use Anaconda to install a prebuilt scipy and avoid the Fortran and C compilers.
I've used Anaconda for Python 2.7 in the past, so I created an Anaconda environment for Python 3 following these directions.
Command to create the environment
conda create -n py3k python=3 anaconda
And the command to activate the environment
source activate py3k
This works fine, but I do most of my development in PyCharm and I can't figure out how to activate the Anaconda environment from PyCharm. Is there a way to do this or should I take another approach?
Explanations how to configure PyCharm with Anaconda can be found in the documentation.
In PyCharm preferences you can just select the correct python interpreter under,
Project Interpreter > Python Interpreters
As pointed out by #Cecilia, in the case when a virtual environment (e.g. named py3k) is used with Anaconda, the correct python interpreter is located under,
~/Anaconda/envs/py3k/python.exe

ImportError: cannot import name '_imagingtk'

I am using Anaconda with python 3.4 and I am not able to get all the pillow packages I need I am afraid on Windows 8.1.
I installed pillow via the Anaconda console with:
pip install pillow
which lead to:
The following packages will be UPDATED:
conda: 3.10.0-py34_0 --> 3.10.1-py34_0
conda-env: 2.1.3-py34_0 --> 2.1.4-py34_0
pillow: 2.7.0-py34_0 --> 2.8.1-py34_0
pip: 6.0.8-py34_0 --> 6.1.1-py34_0
setuptools: 14.3-py34_0 --> 15.0-py34_0
Now, in the spyder IPython console I start with: import tkinter, from PIL import ImageTk I have no errors here, but when executing ImageTk.PhotoImage(file='a.jpg') I receive an error, telling me: ImportError: cannot import name '_imagingtk'
What did I miss?
I know this is not a complete answer, but I have had the same problem and spent a day trying to figure it out...
Here is a small subset of things I tried yesterday to the best of my weak memory...
-Tried upgrating to the latest Python environment using anaconda (tip: you can create one using
conda update conda
conda update anaconda
(I think that's it, but may have tried to make sure for key packages explicitly etc.)
-Tried using Python 3.3 environment using anaconda (tip: you can create one using
conda update conda
conda create -n py33 python=3.3 anaconda
activate py33
-Tried using PythonWin instead of anaconda (that one took some time, had to install packets like numpy manually...)
-Tried updating / downgrading / installing/ uninstalling all kinds of different variations of Pillow, PIL, etc....
-Tried using opencv instead of PIL, though did not try to write my own components...
-Tried manually copying Tcl/tk and a few others to the lib directory as suggested by some posts
-Tried using import tkinter instead of Tkinter, using import Image vs. form PIL import Image (and in general taking Image from PIL, or opencv, or Tkinter) and a lot of other similar changes to the point it fell I was doing silly things
-...
At the end, I googled a few pages about GUIs in python, and now I am using wx... I had to run
conda install wxpython
and that was it. I have to say that after all this, I am presently surprised by how easy it was to make it work, here is a code example...
You need tcl/tk library.
Install them using apt-get
Do sudo apt-get install tk8.6-dev tcl8.6-dev
--Reference.

Resources