3

So I have a virtual environment where I installed the package utility. I know I installed it because when I do pip install utlity and get this output:

Requirement already satisfied: utility in ./anaconda3/envs/SpliceBuster/lib/python3.5/site-packages (1.0)

Here's the output of print (sys.path):

['', '/home/joel/anaconda3/envs/SpliceBuster/lib/python35.zip', '/home/joel/anaconda3/envs/SpliceBuster/lib/python3.5', '/home/joel/anaconda3/envs/SpliceBuster/lib/python3.5/plat-linux', '/home/joel/anaconda3/envs/SpliceBuster/lib/python3.5/lib-dynload', '/home/joel/anaconda3/envs/SpliceBuster/lib/python3.5/site-packages']

When I do import utility in a python shell, I get:

Traceback (most recent call last):
File "<stdin>", line 1, in
ImportError: No module named 'utility'

It's confusing to me because I can import numpy, and when I do pip install numpy, the output is:

Requirement already satisfied: numpy in ./anaconda3/envs/SpliceBuster/lib/python3.5/site-packages (1.12.1)

which means that both utility and numpy are installed in the same folder, but numpy is found whereas utility isn't.

Any thoughts on what could be going on?


Other info:

which python:

/home/joel/anaconda3/envs/SpliceBuster/bin/python

python -V:

Python 3.5.0 :: Continuum Analytics, Inc.

2 Answers2

1

Are you sure you want to use this package? Looking at Pypi there seems to be no description and the source code of the project is nowhere to be found.

Looking at the package content, it's clear the setup.py is incomplete as well as the package itself.

The name to import is utilitybelt and not utility, yet you will encounter other importing issues as the package depends on other third party modules which are not listed in the setup.py.

noxdafox
  • 14,439
  • 4
  • 33
  • 45
  • thank you, turns out this was not the package I wanted, rather the `utility` that I wanted was supposed to be in the same directory as my file, but I deleted it somehow! Thanks! – Joel Castro Feb 23 '19 at 21:14
-2

Try to place the module's folder into the same directory where you have the script you want to execute. This way we could discard a folders' tree issue.

4b0
  • 21,981
  • 30
  • 95
  • 142
Kaladin
  • 21
  • 4
  • You refer to external libraries or packages while OP is referring in comments to one of its own py-files that include this method. So your solution will not work. Also its a bad choice of solution if project is terminated early or finished and removed afterwards while another project relies on it (dependencies). End of Review. – ZF007 Oct 22 '20 at 08:39