I'm moving on up to Python 3, but can't seem to find an IPython release for it. The main IPython release page doesn't list anything appropriate. Any help in getting IPython working for Py3k would be much appreciated.
See the ipython dev mailing list
EDIT : see the Ipython 3 page - where now (Jan 2011) it says there is a version for python 3 in source code version only
EDIT: and now iPython supports python 3 directly.
Python 3 support has been around for a fairly long time now. You don't need a different version. IPython supports modern versions of Python 2 and 3. You just run IPython with the appropriate interpreter, python3 ipython.py. You can install IPython on Python3 by running setup.py with your Python3 interpreter.
Related
Having several exe's of Python, I would like to specify the command (py or python) to launch a certain version from the command line.
At the moment, I have different versions of Python (2.7, 3.6, 3.7 Anaconda) installed on my Windows machines (7 at work, 10 at home). Unfortunately, the commands in the cmd-prompt are not the same.
The output of the following cmd commands is as follows:
py -> 3.7.1 of Anaconda (work) and 3.7.0 (home)
python -> 2.7.13 (work) and 3.6.2 (home)
pyton2 -> not recognized (work) and 2.7.15 (home)
How can I order the variables, so the same commands call the same version of python? Researching about the path variable I could not find how to define the command that launches a specific python.exe.
I really appreciate your help or a pointing in the right direction.
Kind regards,
Seb
Good Morning,
my apologies, yesterday I did not find this thread here:
In CMD "python" starts Python 3.3, "py" starts Python 2.7, how do I change this?
From now on I will go with "py -X.Y" to start the version of Python I want.
Kind regards,
Seb
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/
I'm using Anaconda to manage both Python and Jupyter. That is:
>> which python
>> /home/.../software/anaconda3/bin/python
and
>> which jupyter
>> /home/.../software/anaconda3/bin/jupyter
But Jupyter's python kernel seems to be pointing to a system version of Python rather than my local version through Anaconda, since the sys.path is different in a Jupyter Python 3 notebook. Also, jupyter kernelspec list gives the following:
Available kernels:
ir /usr/local/share/jupyter/kernels/ir
matlab /usr/local/share/jupyter/kernels/matlab
python3 /usr/local/share/jupyter/kernels/python3
This doesn't seem altogether surprising since the docs say in section 1.5.5:
By default, kernel specs will go in a system-wide location (e.g. /usr/local/share/jupyter/kernels). If doing a --user install, the kernel specs will go in the JUPYTER_DATA_DIR location.
For personal sanity and organization, I want the version of Python that I use in the command line to be the same that is accessed in Jupyter. As a result, I think that what I should do is change my jupyter kernelspec list for python3 so that it points to my desired Anaconda python version, i.e. /home/.../software/anaconda3/bin/python. My questions are: 1) is that indeed the best solution for my stated preferences, and 2) how do I actually change my jupyter kernelspec entry for python3? Not sure if this will come up, but I don't want to be using virtual environments--I want the default to be same version of Python across both the command line and Jupyter.
I ended up reposting this to the Jupyter Github issues page, and was recommended to delete /usr/local/share/jupyter/kernels/python3. This allows Jupyter to find a default Python kernel using the same Python running Jupyter itself (i.e. Anaconda), and this worked for me.
You can find my post on Jupyter's Github page as well as an explanation for why the above solution works here.
1) Jupyter kernels in /usr/local/ are indeed a global install. But I do not see why it couldn't be linked to your anaconda python3 interpreter.
2) To explicitly link your anaconda interpreter to your jupyter install you can run :
pip install ipykernel
python -m ipykernel install --prefix=/usr/local/ --name "anaconda_kernel"
for a global install, or change /usr/local/ if you want a per user install. A doc is specially set for anaconda here
If you combine it with jupyter kernelspec remove python3 beforehand, you can then reset your anaconda kernel as default to be sure.
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
I have installed Anaconda on Windows 7 from the full installer and then created an Anaconda Python 3 environment (py3k) using conda. From my reading of the installation instructions at
http://continuum.io/blog/anaconda-python-3
I type activate py3k at the Anaconda command prompt to obtain that environment and in the Command Prompt window it says
[py3k] C:\users.. etc
which would appear to indicate that I am, in fact, in a Python 3.X environment. However, when I type 'Python' at the prompt I get
Python 2.7.5 | Anaconda ... etc
Am I still in a Python 3.X environment or have I omitted to do something installation-wise or otherwise?
have you tried unset PYTHONPATH, and which python?
If you do that after activating py3, you should be able to the python 3 interpreter. If not, what do you get after executing which python?