Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'info' on fresh Python 3 installation

I did a fresh python3 installation on OSX via homebrew:

brew install python3

Then I created a virtual environment for my project and installed scipy and scikits.samplerate:

virtualenv -p /usr/local/bin/python3 pythen_env 
pip install scipy
pip install scikits.samplerate

However, when I try to import a function from scikits.samplerate, I get the following error:

>>> from scikits.samplerate import resample
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/my/project/path/pythen_env/lib/python3.6/site-packages/scikits/samplerate/__init__.py", line 4, in <module>
    from info import __doc__
ModuleNotFoundError: No module named 'info'

Info happens to be the first module from the package itself that is imported in __init__.py.

Strangely, the module info.py exists in /my/project/path/pythen_env/lib/python3.6/site-packages/scikits/samplerate/:

ls /my/project/path/pythen_env/lib/python3.6/site-packages/scikits/samplerate/
__init__.py    setup.py        tests        __pycache__
info.py        setuphelp.py    version.py

The error also happens when I try the same without virtualenv, as well as for other packages. How could I start to debug this issue?

like image 857
Emiswelt Avatar asked Apr 02 '17 09:04

Emiswelt


People also ask

How do I fix No module named pip?

To fix the error with python -m pip To verify that, run python --version . If you get a Python 2 version, try python3 --version . If you don't get errors (and receive a Python 3 version), replace python -m pip with python3 -m pip . That should fix your No module named pip issue.

How do I fix usr bin python3 No module named pip?

While this error can come due to multiple reasons but in most of the cases you will see this error because of pip package not installed in your System. So to solve this kind of error, you need to simply install pip package from the default Repo.


2 Answers

The problem seems to be that the package scikits.samplerate does not support Python 3.X (see issue). However, there is a fork which supports Python 3.X. You can install it via

$ pip install git+https://github.com/gregorias/samplerate.git

As always: people can make anything they like in repositories. I did not check which changes gregorias made.

like image 140
Martin Thoma Avatar answered Jan 01 '23 09:01

Martin Thoma


the git version does support py3

https://github.com/cournape/samplerate

(merged the PR from @gregorias)

I should find the time and procedure to update pypi too...

like image 39
Thomas Lecocq Avatar answered Jan 01 '23 10:01

Thomas Lecocq