I have Pydev 2.7, Python 3.2 and IPython 0.13 installed.
However, when I run the interactive console in Eclipse it says
PyDev console: using IPython 0.11
I cannot imagine where IPython 0.11 is supposed to come from. How can I check?
After running the console, import IPython; IPython.__version__ also gives me the correct version 0.13.
Is it IPython 0.13 in the console now or is something wrong?
I think you're fine. I tried
IPython.__version__
and also get 0.13 in the PyDev console:
import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
C:\Python27\python.exe 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
PyDev console: using IPython 0.11
import IPython
IPython.__version__
Out[1]: '0.13.1'
Related
First, I may have more of an issue with correct environment selection. I did a fresh install of Linux Mint 19 and apt dist-upgrade... etc... and then used apt-get and pip to install pymysql, pil.intertk and pylint for both python and python3 from the cli...
All is good from cli:
~$ python3 --version
Python 3.6.5
~$ pylint3 --version
No config file found, using default configuration
pylint3 1.8.3,
astroid 1.6.0
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0]
python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymysql
>>> import PIL
>>>
After installing VSC.... the only two selection of python environments are 2.7.12 and 3.5.2 ?
I then modified VSC settings with: "python.pythonPath": "/usr/bin/python3"
Which still shows as Python 3.5.2 64-bit within VSC
But here comes my issue that I have tried many suggestions I have found from searching with no luck...
pylint is not finding any module I install. I assume its due to the mix match of version ? But not sure how to resolve that?
When I try to specify the pylint path : "python.linting.pylintPath": "/usr/bin/pylint3"
I get an invalid path error in VSC.. but its a valid path
~$ which pylint3
/usr/bin/pylint3
Any help would be greatly appreciated....
So after some frustrating trail and error I have fixed the issue by uninstalling the Flatpak version of Visual Studio Code listed in the Linux Mint's Software Center... and installing the deb package from the official site.
After installing the deb package... the proper version of python are showing and pylint is working correctly.
If I invoke ipython and ipython3, both show exactly the same message:
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.
Is not it that ipython shows something like Python 2?
How can I make ipython use Python 2?
IPython 6+ requires Python 3.3+, so that's what it defaults to, and it will not open Python 2.x.
From the 6.x Series page in the IPython docs:
Important
This documentation covers IPython versions 6.0 and higher. Beginning
with version 6.0, IPython stopped supporting compatibility with Python
versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7,
please use the IPython 5.x LTS release and refer to its documentation
(LTS is the long term support release).
If I 'source activate' a non-root environment (in my case "data"), then launch Jupyter notebook, the env seems to switch to root. I can tell because if I try to open a new python notebook, the dropdown under New says Python [Root]. I am also unable to import packages in my env, but not in root.
(data) Edwards-MacBook-Pro:~ mango$ conda list
# packages in environment at /Users/mango/anaconda/envs/data:
#
boto 2.42.0 py35_0
bz2file 0.98 py35_0
cycler 0.10.0 py35_0
freetype 2.5.5 1
gensim 0.12.4 np111py35_0
libpng 1.6.22 0
matplotlib 1.5.1 np111py35_0
mkl 11.3.3 0
numpy 1.11.1 py35_0
openssl 1.0.2i 0
pandas 0.18.1 np111py35_0
pip 8.1.2 py35_0
pyparsing 2.1.4 py35_0
pyqt 4.11.4 py35_4
python 3.5.2 0
python-dateutil 2.5.3 py35_0
pytz 2016.6.1 py35_0
qt 4.8.7 4
readline 6.2 2
requests 2.11.1 py35_0
scikit-learn 0.17.1 np111py35_2
scipy 0.18.1 np111py35_0
seaborn 0.7.1 py35_0
setuptools 27.2.0 py35_0
sip 4.18 py35_0
six 1.10.0 py35_0
smart_open 1.3.4 py35_0
sqlite 3.13.0 0
tk 8.5.18 0
wheel 0.29.0 py35_0
xz 5.2.2 0
zlib 1.2.8 3
(data) Edwards-MacBook-Pro:~ mango$ ipython
Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12)
Type "copyright", "credits" or "license" for more information.
IPython 4.2.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import seaborn
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-085c0287ecb5> in <module>()
----> 1 import seaborn
ImportError: No module named 'seaborn'
In [2]:
The same behavior occurs with gensim, so it is not just seaborn.
I managed to solve the issue. Conda installs the [root] environment with ipython and jupyter. If you create an env, those are not available by default. So when creating and env, either be sure to list those packages explicitly, or clone root. Cloning root may make a bulkier env and it may be less desirable for production, but better for a sandbox context.
I discovered this issue by trying the same test above with python and finding that my packages indicated that I was in the data env. I then decided to try the Anaconda Navigator program with conda install anaconda-navigator. While I like a cli, this GUI based program seems like a better way to manage packages.
I'm using Eclipse kepler & pydev 3.4.1 on Ubuntu 12.04.
I installed ipython 0.12.1 via pip, which was located in /usr/lib/python2.7/dist-packages/, so I added this path to PYTHONPATH via eclipse->preference->PyDev->Interpreters->Python Interpreter->System PYTHONPATH.
By this way, I would start IPython in the interactive console(just press CTRL_ALT_ENTER), the output is :
Python 2.7.3 (default, Feb 27 2014, 20:00:17) Type "copyright",
"credits" or "license" for more information.
IPython 0.12.1 -- An enhanced Interactive Python. ? ->
Introduction and overview of IPython's features. %quickref -> Quick
reference. help -> Python's own help system. object? -> Details
about 'object', use 'object??' for extra details.
PyDev -- Python IDE for Eclipse For help on using PyDev's Console see
http://pydev.org/manual_adv_interactive_console.html
It looks fine, but when I try to run a simple code in the interactive console, say:
from common_function import *
if __name__ == '__main__':
print("hello")
It shows me an ImportError:
File "/git/mycode/python_lab/pylab/simple_test.py", line 7, in
from common_function import *
ImportError: No module named common_function
Here, the simple_test.py and common_function.py are placed in the same src folder, and I find some posts on stackoverflow saying that adding the src folder which contatins all the py files to project's PYTHONPATH would solve this problem, so I tried and it did solve the ImportError, but the IPython is disable, the output of interactive console is :
/usr/bin/python2.7 2.7.3 (default, Feb 27 2014, 20:00:17) [GCC 4.6.3]
PyDev console: using default backend (IPython not available).
runfile('/media/data/yanglin/local/work/git/mycode/python_lab/pylab/simple_test.py')
hello
Any one know how to fix this problem?
I would like to use the IPython interpreter in Eclipse/PyDev.
PyDev however does not recognize my IPython installation.
The results I get is the following:
>>> import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
PyDev console: using default backend (IPython not available).
D:\QuantumGIS\apps\Python25\python.exe 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
>>> import IPython
>>>
The "import IPython" command does work.
I'm using
Windows XP 32 bit
Eclipse 3.7.2
PyDev 2.4.0
IPython 0.10.2
Python 2.5 (version that is supplied with QGIS 1.7.3)
How should I set up PyDev so I can use IPython as the interactive interpreter?
Not sure if it's the same issue but from Fabio's blog he said to try in the python console (import IPython worked ok):
from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
which gave me nothing useful and:
from IPython.frontend.prefilterfrontend import PrefilterFrontEnd
Which complained that twisted wasn't installed. I installed twisted 12.0 for Python 2.5 and it's dependency Zope (3.8 for Python 2.5), restarted the IDE and the console now shows ipython. There was something about ipython actually using XMLRPC to communicate with the IDE so I guess twisted is needed for that.
Hope that helps.
Stu.
Windows 7
Aptana studio 3.1.2 (version of eclipse)
PyDev 2.5.0 IPython 0.10
Python 2.5 (needed for some old code I'm working on and haven't
upgraded yet)