I've looked at several posts and articles and I can't seem to find a solution to this. I need to use jenkspy for a specific task but my Python3x was installed with a software called ArcGIS Pro that designates the default python environment "Read Only" meaning that packages not installed with it must be installed in a virtual environment.
So, I opened command line and ran:
py -m venv env
py -m pip install jenkspy --user
If I continue to run python from command window I can import jenkspy no problem. However, when I attempt to import it in iPython or load it into pythonWin as a script I get:
import jenkspy
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'jenkspy'
So I go back to command window and run python to locate path for jenkspy:
import sys
print (sys.path)
which returns:
['', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\Lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\Lib\\idlelib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\python37.zip', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\DLLs', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64', 'C:\\Users\\johnsmith\\AppData\\Roaming\\Python\\Python37\\site-packages', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\lib\\site-packages']
I navigate to the native idle.py file in this environment and import jenkspy. No problem. I print sys.path from the idle console. Same result as in command line.
I then go back to iPython and run:
import sys
paths = ['C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\Lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\Lib\\idlelib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\python37.zip', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\DLLs', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64', 'C:\\Users\\johnsmith\\AppData\\Roaming\\Python\\Python37\\site-packages', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_64\\lib\\site-packages']
for p in paths:
sys.path.append(p)
and then:
import jenkspy
And I get this error:
ImportError Traceback (most recent call last)
<ipython-input-19-88ab181dc114> in <module>
----> 1 import jenkspy
~\AppData\Roaming\Python\Python37\site-packages\jenkspy\__init__.py in <module>
3 __version__ = "0.1.5"
4
----> 5 from .core import jenks_breaks
6
7
~\AppData\Roaming\Python\Python37\site-packages\jenkspy\core.py in <module>
7 from math import isinf, isnan
8 isfinite = lambda x: not isinf(x) and not isnan(x)
----> 9 from . import jenks
10 try:
11 import numpy as np
ImportError: cannot import name 'jenks'
What do I need to do in order to get jenkspy or other post python installation packages/modules to be imported using stand alone scripts and or/iPython?