I'm trying to create my own python package on Github so I can install it on any machine. It's installing and the module is there when doing pip3 freeze
but there is an import error.
I've searched for "import error with module in pip" and couldn't find a relevant article specifically addressing this issue.
Here are my terminal commands:
>>>sudo -H pip3 install git+git://github.com/iethan/machine_learning.git
Collecting git+git://github.com/iethan/machine_learning.git
Cloning git://github.com/iethan/machine_learning.git to /private/tmp/pip-kupvue2i-build
Installing collected packages: machine-learning
Running setup.py install for machine-learning ... done
Successfully installed machine-learning-0.0.1
When I try to import it there is an error:
Traceback (most recent call last):
File "test_staging.py", line 1, in <module>
import machine_learning
ImportError: No module named 'machine_learning'
There must be something wrong with my setup file but I'm not sure what it is.
Update
The issue was in the setup file.
packages=['MachineLearning']
Should have been:
packages=['MachineLearning',
'MachineLearning.get_data',
"MachineLearning.pre_processing",
"MachineLearning.train_test_optimize"],