Error while installing scipy and sklearn in PyCharm - scipy

I am using PyCharm and I ran into some errors while installing scipy and sklearn but not numpy, matplotlib and pandas. I tried browsing "Christopher Gohkle's "Python Extension Packages For Windows" as this problem seems to happen before but the site is now refusing connection. Any other way to solve this problem? Thanks!
Error message

Christopher Gohkle's site is up now. You can just check it out again.
But I suggest you to install Anaconda instead. It includes scipy and installation is so easy.

Related

Error when install scipy and seaborn on jupyter notebook

I'm using Macbook Pro(apple m1), and I've installed scipy and seaborn on my laptop with no problem. Now I'm trying to install scipy and seaborn on Jupyter Notebook(NumPy, pandas, and matplotlib installed on jupyter with no problems), but I'm getting error messages as the screenshot below. It seems like a problem about openblas, BLAS & LAPACK on my Jupiter notebook environment. Please help. Thanks!
enter image description here
enter image description here
enter image description here
I eventually found this answer from another post, it worked.
pip install --pre -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy

Plotly installed, but VSCode doesn't seem to think so

I'm trying to learn how to use Plotly using VSCode, but the minute I run my code from the terminal, it says ModuleNotFoundError: No module named 'plotly' Any idea why this is happening? Python is installed via Anaconda, and if I try to do pip install plotly it tells me it's already installed. I've tried nearly everything I can find about this issue and nothing works. Any suggestions would be appreciated.
I'll also add that when I do pip install plotly it gives the following:
Requirement already satisfied: plotly in /Users/username/opt/anaconda3/lib/python3.8/site-packages (4.14.3) Requirement already satisfied: retrying>=1.3.3 in /Users/username/opt/anaconda3/lib/python3.8/site-packages (from plotly) (1.3.3) Requirement already satisfied: six in /Users/username/opt/anaconda3/lib/python3.8/site-packages (from plotly) (1.15.0)
It's possible that you have multiple python versions installed and pip installed plotly for the wrong version. Try to do pip --version and in your code (before the plotly import) do
import sys
print(sys.version)
to see if the python versions match. If they don't, you may have to call pip3 install instead.
(Would have posted this as a comment, but don't have enough reputation).
Accidental fix found: I was working with the bash shell on the VS Code terminal. I switched to the zsh shell by doing exec zsh. When I ran the file using the zsh shell, everything worked.

IPython notebook kernel dies on import

I am running IPython Notebook on Enthought's Canopy 64 bit distribution, Ubuntu 14.04.
I've tried install libtiff, but when I import it in IPython Notebook, the kernel always dies at the import statement. What could possibly be causing this? Canopy is my default Python distribution, my paths all seem like they're set up appropriately, although I'm convinced that something in my Python setup is borked.
Any advice is appreciated.
EDIT: I'll be more specific. Output of sys.path:
['',
'/home/joe/Enthought/Canopy_64bit/User/src/svn',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python27.zip',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/plat-linux2',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/lib-tk',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/lib-old',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/lib-dynload',
'/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages',
'/home/joe/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PIL',
'/home/joe/opencv-2.4.9',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/site-packages',
'/home/joe/Canopy/appdata/canopy-1.4.1.1975.rh5-x86_64/lib/python2.7/site-packages/IPython/extensions']
As for how to install Python packages, I assume I go to ~/Enthought/Canopy_64bit/User/lib/python2.7/site-packages and run pip, setup.py, or a shell script, per the specific package's instructions. Is that correct? The article that I linked has the following line: "To install a package which is not available in the Canopy / EPD repository, follow standard Python installation procedures from the OS command line.", which seems to imply that I install per package instructions.
In .bashrc, I have the following:
VIRTUAL_ENV_DISABLE_PROMPT=1 source /home/joe/Enthought/Canopy_64bit/User/bin/activate
export PYTHONHOME=/home/joe/Enthought/Canopy_64bit/User/bin
export PATH=/home/joe/Enthought/Canopy_64bit/User/bin
export PYTHONPATH=/home/joe/Enthought/Canopy_64bit/User/bin
From what I understand of the linked articles, this means I'm setting Canopy User as my default Python distribution. I'm sure I'm doing something a bit over my head here, but I can't understand what else I need to do to fix this issue.
Worse yet, now I'm getting an "ImportError: No module named site" with these .bashrc settings, when trying to start IPython notebook or python from the command line. I can run only from the Canopy GUI.
Closing this. I made it harder than necessary.
It turns out, the PYTHONHOME and PYTHONPATH .bashrc variables were causing some conflicts. Commenting them out seems to have resolved the issue.
Installing outside packages does, indeed, happen from the home (~) directory.

error Matplotlib backend_wx and backend_wxagg require wxPython >=2.8

I have installed Enthought in Amazon but I get this error
Matplotlib backend_wx and backend_wxagg require wxPython >=2.8
when I run ipython --pylab.
How can I install wxpython2.9
I tried everything on the internet and it doesn't seem anything to work.

Import error when using a python script that do not occur in ipython

All my install for python were working pretty well since soon. Now, I have a weird issue that generates import errors for some of my Python scripts and when using Ipython those import performs as expected.
This issue does not depend on the working dir (tested this several times with the same result). And I didn't change anything in my .bashrc regarding PYTHONPATHs.
So this might be a noob question, but is there an option in Ipython to display everything Ipython is doing when I run a command, so that I can track which is the package Ipython succesfully imported?
The packages I have trouble with are actually yaml, matplotlib cloud Image. Is it possible that an update from 2.6 to 2.7 is responsible for that? (I work on OSX Lion and most of the packages are installed via macports and updated using the upgrade outdated command).
As I think I can probably fix this myself with the command I asked for, don't bother seeking further for package compatibility or anything if you got the Ipython command that might suits me.
The difference of imports between python and ipython resulted from a cross defined python reference library (when installing most of the python libraries with macports and some without any known ports with other package managers).
Reinstalling the whole python libraries using the process described in http://astrofrog.github.io/macports-python/
corrects the issue and it is preferable to install manually the libraries that don't have any known ports (for instance with a setup build/install process).