How would you recommend I install the scipy stack on a RHEL 6.3? I tried the Anaconda distribution, which seems to install fine, however the tests for scipy fail miserably (tests for numpy work):
>>> import scipy
>>> scipy.test()
Running unit tests for scipy
NumPy version 1.7.1
NumPy is installed in /anaconda/lib/python2.7/site-packages/numpy
SciPy version 0.13.2
SciPy is installed in /anaconda/lib/python2.7/site-packages/scipy
Python version 2.7.6 |Anaconda 1.8.0 (64-bit)| (default, Nov 11 2013, 10:47:18) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)]
nose version 1.3.0
/anaconda/lib/python2.7/site-packages/numpy/lib/utils.py:139: DeprecationWarning: `scipy.lib.blas` is deprecated, use `scipy.linalg.blas` instead!
warnings.warn(depdoc, DeprecationWarning)
/anaconda/lib/python2.7/site-packages/numpy/lib/utils.py:139: DeprecationWarning: `scipy.lib.lapack` is deprecated, use `scipy.linalg.lapack` instead!
warnings.warn(depdoc, DeprecationWarning)
..............................................................................................................................................................................................................................K..................................................................................................................K.......................................................................................K..K......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................SSSSSS......SSSSSS......SSSS......................................................................................0-th dimension must be fixed to 3 but got 15
..0-th dimension must be fixed to 3 but got 5
..................................K..............................................................................................................................................................................................................................................................................................K....................................................................................................................................................................Segmentation fault (core dumped)
Related
The Jupyter docs recommend using conda to install jupyter, if the runtime python is version 3.5 or lower. Installation is pretty straightforward with conda.
Follow Anaconda’s instructions for downloading and installing the Python 3.5 version.
$ conda install jupyter
$ pip list | grep ipython
ipython 7.29.0
ipython-genutils 0.2.0
$ ipython notebook --ip=0.0.0.0
This question is to discover if it's possible to install a 3.5 compatible jupyter using only pip, and without conda.
Given the following environment:
$ python --version
Python 3.5.2
$ sudo apt-get install python3-pip
$ pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
Installing ipython is possible with the following restrictions:
$ python3 -m pip install ipython==7.9 traitlets==4.3.3 jedi==0.17.2
Jupyter, however, doesn't install gracefully.
The following allows for installation:
pip3 install jupyter ipython==7.9 traitlets==4.3.3 jedi==0.17.2 pyzmq==20 argon2-cffi==21.1.0
But at runtime, jupyter crashes:
File "/home/vagrant/.local/lib/python3.5/site-packages/ipython_genutils/importstring.py", line 31, in import_item
module = __import__(package, fromlist=[obj])
File "/home/vagrant/.local/lib/python3.5/site-packages/notebook/__init__.py", line 27, in <module>
from .nbextensions import install_nbextension
File "/home/vagrant/.local/lib/python3.5/site-packages/notebook/nbextensions.py", line 15, in <module>
from jupyter_core.paths import (
File "/home/vagrant/.local/lib/python3.5/site-packages/jupyter_core/__init__.py", line 1, in <module>
from .version import version_info, __version__
File "/home/vagrant/.local/lib/python3.5/site-packages/jupyter_core/version.py", line 21
_suffix_ = f'.dev{version_info.serial}'
Is it possible to install a 3.5 friendly jupyter using pip?
Resources
pyzmq https://github.com/jupyter/notebook/issues/5961
iPython Versions
https://github.com/ipython/ipython/blob/master/README.rst
IPython 7.10+ supports Python 3.6 and above.
When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
Python 3.3 and 3.4 were supported up to IPython 6.x.
Python 3.5 was supported with IPython 7.0 to 7.9.
traitlets vs. python 3.5
Traitlets 5 uses f-strings in code, not compatible with Python 3.5
uninstall the traitlets 5.0.3 version, and install 4.3.3 version
https://githubmemory.com/repo/ipython/traitlets/issues/620
argon2-cffi vs. python 3.5
https://packagegalaxy.com/python/argon2-cffi
It targets Python 3.6 and newer, and PyPy3.
The last version that works with Python 2.7 is 20.1.0, and the last version that works with Python 3.5 is 21.1.0.
jedi vs. python 3.5
https://jedi.readthedocs.io/en/latest/docs/changelog.html
0.17.2 (2020-07-17)
This will be the last release that supports Python 2 and Python 3.5. 0.18.0 will be Python 3.6+.
I'm kind of new to Scipy and IronPython, so please excuse any dummy question I might be asking.
Anyway, I'm trying to upgrade my scipy version to >1.1 on my IronPython 2.7.5 (OS is Windows 7 64bit) but I am not really sure how to do it.
My current scipy version is 1.0.0.
I've tried to run from command prompt:
ipy -X:Frames -m pip install --upgrade scipy
But I'm getting this:
Downloading/unpacking scipy
C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py:1: DeprecationWarning: object.__new__() takes no para
meters
# urllib3/connectionpool.py
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement scipy
Cleaning up...
No distributions at all found for scipy
Any help on how to get it to work will be appreciated. Alternatively, if there are other ways to easily install newer compiled version of scipy on IronPython env, it's also OK - I just need to know.
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 '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 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)