I have both python 2.7 and python 3.4 installed on my mac.
IDLE is using the latter, how can I change that ?
I looked for idle in python2.7 folder under /Library/Python but all I can find under Python2.7 is a folder having the name site-packages.
you may try by changing the system variables....I don't know particularly about mac but in window we can do so.You may refer the following link.
=======================
https://www.youtube.com/watch?v=IX6mc9l6tY4
Related
I have been struggling with multiple versions of Python on Ubuntu 16.04. I have versions 2.7 and 3.5. I have followed the steps from the Anaconda site as to how to switch from one environment to another with "source activate snakes". That works well when just looking at the default when calling python from the terminal, but when I attempt to open spyder IDE, no matter what other version is the default, it just opens on python 2.7.
Any ideas how this can be switched in a non permanent way, since I need both versions of Python?
Thanks in advance,
Do you have spyder3? I have spyder and spyder3. Depending on which of those spyders I'm opening the default python would be 2.7 for spyder and 3.5 for spyder3. I open spyders from terminal in ubuntu. That might not be the most reasonable solution, but it works.
i recently started using python with xubuntu on virtualbox but i'm having problems. I want to be able to use numpy so i thought that apt-get install python-numpy would solve everything, but using the shell i kept getting No module named numpy. I used IDLE and it could find it. I also have IDLE (using Python-2.7), and again it could import numpy. Then i noticed that the shell had python 2.7.9, while the IDLEs had python 2.7.6.
Using
import sys
print sys.path
this if what i get from 2.7.9 (shell)
/usr/local/lib/python2.7/site-packages/setuptools-17.0-py2.7.egg
/usr/local/lib/python2.7/site-packages/Pillow-2.3.0-py2.7-linux-x86_64.egg
/usr/local/lib/python2.7/site-packages/mock-1.0.1-py2.7.egg
/usr/local/lib/python27.zip
/usr/local/lib/python2.7
/usr/local/lib/python2.7/plat-linux2
/usr/local/lib/python2.7/lib-tk
/usr/local/lib/python2.7/lib-old
/usr/local/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/site-packages
and from 2.7.6 (IDLE)
/home/alessandro
/usr/bin
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/PILcompat
/usr/lib/python2.7/dist-packages/gtk-2.0
/usr/lib/pymodules/python2.7
/usr/lib/python2.7/dist-packages/ubuntu-sso-client
I understand that i have two versions of python installed and somehow i ended up installing packageg into only one of them (the 2.7.6).
I'd like to be able to use 2.7.9 both in the shell and in IDLE and also i'd like to install so that python 2.7.9 can see them.
I read that i can add paths to the python sys.path, but isn't there a more efficient/persistent way to do what i want?
PS: tell me if you need more informations
For my projects I usually create a virtualenv for each python version I need for the project at hand. I manage them using pip to install specific versions that I need. Moreover you should be able to choose the python path in your IDE. While I'm not using IDLE, I read here that apparently idle comes along with the python versions during install. So maybe your idle versions collide with each other. If you want to have only one python version at the time on your machine you might consider a simple remove and fresh install of your desired version. Again I would recommend pip over apt-get etc. Hope this is of help for you.
Worth to check PyDev, a plugin for Eclipse to work on python.
http://marketplace.eclipse.org/content/pydev-python-ide-eclipse , or http://pydev.org/.
This allows you to configure the python version for different project's.
I have some project's with python 2.7 and others with 3.4.
it's checks the whole system in search for the PYTHONPATH to use!
I work on Ubuntu with Wingware Python IDE. The version, which we use by our projects is 2.7.X
This morning I updated the IDE, and it became a version >3.x.x
Now I want to install the old version 2.7.3, after I read TFM and try to define PYTHONPATH, I check my Python version on Ubuntu with the command:
python --version
and got the answer 2.7.3. Now I can not understand, why I have version 3.x.x in Wingware and how exactly (the import file is not clear) I can change my version after setting Python manually described here
Actually: It depends on wingware, because I can execute Python 2.7.3 in IPython and in console.
EDIT: I solved this problem myself. Here's my solution:
Following the manual:
Use Python - Executable
Use Interpreter to find right path (in my way it was /usr/bin/python3.2)
Go in /usr/bin/
Select right Python version. This path has ALL Python versions, you should just select the right one
I solve this problem someself. I post now my solution for other people.
After [manual][2] using:
Use Python - Executable
Use Interpreter to find right path (in my way it was /usr/bin/python3.2)
Go in /usr/bin/
Select right python version. This path has ALL Python version, you should just select the right one
I have just installed Ubuntu 12.04 which comes with Python 2.7. I have installed Python 3.3, so now I have both versions. For example, if I type python in the terminal I get version 2.7 and if I type python3.3 I get that version.
I don't see why I would need 2 versions (?) so how do I uninstall Python 2.7? And if I do so, will the "python" command then point to Python 3.3?
VERY IMPORTANT EDIT
Removing an older version of python may be very dangerous and can cause trouble in your whole system! For your case instead of removing the older python you can simply use an alias in your terminal, so that when you type python it opens python3.3;
Here is the procedure, add this line:
alias python=python3
Into~/.bash_aliases or: ~/.bashrc
Btw I guess If you ask this question in AskUbuntu you may have a quicker/better response!
You should never remove the builtin Python in your Ubuntu distribution. Bad things will happen if you do.
It is highly recommended to use virtualenv to install other Python environments.
Here's a good Stackoverflow question that demonstrates how:
Is it possible to install another version of Python to Virtualenv?
I am lost in the installation process of installing anaconda on windows.
I've installed the windows 32bit package (I'm running windows 7 x64)
I have anaconda in the start menu and I can open the python console and use scipy.stats.t.interval(), the function I am interested in.
However, how do I go about including this in another python program? I think it's something like adding it to the path. For instance, I have the scipy.stats.t.interval() function call in my other python file which I run through cygwin via python myscript.py. However it returns the error:
from scipy.stats import t
ImportError: No module named scipy.stats
I think it might be a change of path / add to path issue, but I'm not sure how to fix it :/. While I try to fix it, I figure I will post for help here.
well you might have two installations of python, one inside the anaconda package, and other which you might have installed earlier. try doing :
which python
from CygWin console.
If it returns:
/usr/bin
then it is definitely a add-to-path problem.
to fix it for CygWin,
you have to add the python installation from anaconda to the path.
try this fromn CygWin:
PATH=path-where-anaconda-is-installed/anaconda/bin:$PATH
and then doing:
which python
should give you:
/path-to-anaconda/anaconda/bin
and then it will work.
Cheers