downloaded SciPy for python, not able to use it - python

I am trying to download and use SciPy. According to pip I have already downloaded it however when I try to use it python says there is no module named SciPy. I have tried using python as well as python3. Here is a copy of my console:
➜ ~ pip3 install SciPy
Requirement already satisfied: SciPy in /usr/local/lib/python3.6/site-packages (0.19.1)
Requirement already satisfied: numpy>=1.8.2 in /usr/local/lib/python3.6/site-packages (from SciPy) (1.14.3)
➜ ~ pip install SciPy
Requirement already satisfied: SciPy in /usr/local/lib/python3.6/site-packages (0.19.1)
Requirement already satisfied: numpy>=1.8.2 in /usr/local/lib/python3.6/site-packages (from SciPy) (1.14.3)
➜ ~ python
Python 2.7.15 (default, Jun 2 2018, 12:02:49)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import SciPy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named SciPy
>>> exit()
➜ ~ python3
Python 3.6.5 (default, Apr 28 2018, 01:16:46)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import SciPy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'SciPy'
>>> exit()
➜ ~

Imports are case-sensitive. Use
import scipy

Related

Have i installed the socks module in python?

list the packages beginnig at s.
pip list | grep ^s
setuptools 56.0.0
six 1.12.0
sniffio 1.2.0
socks 0
Why the version number is zero?
python3
Python 3.9.6 (default, Jul 14 2021, 09:15:03)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socks
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'socks'
debian#debian:~$ pip3 install socks
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: socks in /usr/local/lib/python3.7/dist-packages (0)
WARNING: You are using pip version 21.1.2; however, version 21.1.3 is available.
debian#debian:~$ python3
Python 3.9.6 (default, Jul 14 2021, 09:15:03)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socks
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'socks'
What is the matter with package----socks in my python?
pip might not be pointing to python3 ?
python3 -m pip list | grep ^s
selenium 3.141.0
setuptools 56.0.0
six 1.16.0
sniffio 1.2.0
socks 0
If you're unsure you have socks installed, use:
pip install socks
in the command prompt. That way it will either tell you that it's installed or install it for you

ModuleNotFoundError: No module named 'sympy'

I'm on MacOSX Mojave 10.14.6 on a MacBook Pro 2015. So I pip installed sympy, right?
I head over to my shell, run python3, and do:
$python3
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:36:03)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sympy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sympy'
Just to be sure, I pip installed again just to make sure.
$ pip install sympy
Requirement already satisfied: sympy in /usr/local/lib/python3.7/site-packages (1.4)
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.7/site-packages (from sympy) (1.1.0)
My pip list also includes sympy as sympy 1.4.
What's wrong here? Is there another setup step I've missed?
Apparently all I had to do was
python3 -m pip install sympy
Mac being weird with two built in pythons and a third python for user.
Pro tip: use a virualenv.

ModuleNotFoundError: No module named 'gffpandas'

Although I installed the below library, I am not able to use it:
$ pip3 install gffpandas
Requirement already satisfied: gffpandas in /usr/local/lib/python3.7/site-packages (1.2.0)
$ python
Python 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 14:38:56)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gffpandas.gffpandas as gffpd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'gffpandas'
What did I miss?
Thank you in advance,

conflict with Python 2.7.6 and 2.7.9 on MAC

It seems my mac has multi-version of Python
python python2.6-config python3 pythoni pythonw2.6
python-config python2.7 python3.3 pythoni1 pythonw2.7
python2.6 python2.7-config python3.3-config pythonw pythonw3.3
Now the packages installed by PIP will be installed in Python 2.7.5
But the default Python is 2.7.6 , so I can not find the package when I use python shell.
How to fix it ?
% pip install pandas (git)-[feature/support-python-with-ruby-python]
...
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/site-packages (from python-dateutil->pandas)
Cleaning up...
[15:25:55](~/workspace/flyberry_projects/03-CFTC-COT/COT/lib)
% python (git)-[feature/support-python-with-ruby-python]
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pandas

ImportError: No module named mandrill

I installed mandrill using pip:
(venv)Jhons-MacBook-Pro:venv jhonjairoroa87$ pip install mandrill
I got this result:
Downloading/unpacking mandrill
Downloading mandrill-1.0.57.tar.gz
Running setup.py (path:/private/var/folders/x3/st96cn215h915kqwlcrmtspw0000gn/T/pip_build_jhonjairoroa87/mandrill/setup.py) egg_info for package mandrill
Requirement already satisfied (use --upgrade to upgrade): requests>=0.13.2 in /usr/local/lib/python2.7/site-packages (from mandrill)
Requirement already satisfied (use --upgrade to upgrade): docopt==0.4.0 in /usr/local/lib/python2.7/site-packages (from mandrill)
Installing collected packages: mandrill
Running setup.py install for mandrill
changing mode of build/scripts-2.7/mandrill from 644 to 755
changing mode of build/scripts-2.7/sendmail.mandrill from 644 to 755
changing mode of /usr/local/bin/mandrill to 755
changing mode of /usr/local/bin/sendmail.mandrill to 755
Successfully installed mandrill
Cleaning up...
But when I try to use it, fails:
(venv)Jhons-MacBook-Pro:venv jhonjairoroa87$ python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mandrill
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mandrill
>>>
>>> import sendmail.mandrill
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sendmail.mandrill
Has anyone had this problem?
I uninstalled it using
pip uninstall mandrill
and reinstalled it using the python -m option:
sudo python -m pip install mandrill
Now it works perfectly.
(venv)Jhons-MacBook-Pro:python_mandrill jhonjairoroa87$ python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mandrill
>>>

Categories

Resources