How to find missing python module

Joined
Nov 20, 2021
Messages
3
Reaction score
1
Points
3
Running on macbook air Big Sur 11.6.1 and having problems with python.
The tools package I am trying to use, coremltools, runs only on 2.7
I though this was not a problem as I can run python 2.7 via python2 command.
I have install the coremltools via pip and confirmed that as far as pip is concerned its installed.
When I start python2 and enter import coremltools I get Module not found
I wanted to try suing from somefilepath import but have not been able to find the path.
Using finder and entering command+shift+g and entering /usr/bin di not work
Using terminal and cd /usr/bin and then ls python* showed my a list of what I thought were folders
but when I tried to cd to any of them I got back 'not a folder'.
I am a windows use trying to do some iOS development training and keep getting bogged down in MacOS.
Anyone either help here or point me in a direction for me to get smarter about MacOS?
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,771
Reaction score
2,111
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
PIP installs modules local to the folder where the requirements.txt file is sitting. Thus, doing the "import" works since it searches in the local folder.

To make this easy for others to help you, a-la Stackoverflow style, provide a simple Python project that shows your problem and those of us who are developers can help you out and give you instructions specific to your project as opposed to generic advice.
 
OP
M
Joined
Nov 20, 2021
Messages
3
Reaction score
1
Points
3
Thanks for the response.
I understand your suggestion and will try and use it next time but what I am after now is help with macos.
I used finder and selected computer as my starting point.
I then tried a search for requirements.txt and got nothing. I tried ./usr and got nothing.
I selected Applications and checked for python and it was not there.
I started terminal and entered cd / and got the root as in Applications Volumes etc sbin ...
I entered cd /usr and ls and got x11 bin libexc sbin ...
I entered cd /bin and ls and got [ dd launchct1 pwd ...
no python
I entered cd ~ and ls and got Desktop Downloads Movies Pictures ...
I do not know how to get to where python is installed.
I was looking for python* folders as I believe modules and installed in the Modules subfolder but as I cannot find the python base folder I am stuck
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top