I'm working on Windows 10 and I have python 3.4.4 pre-installed with a software I need at work (Plaxis). The software has a specific python-module (plxscripting) which only works with that python-version. The executable and all modules are found in the program folderC:\Program Files\Plaxis\PLAXIS 2D\python\
.
For other purposes I also need a later version of python (3.6) and a lot of other modules. I tried downloading Anaconda and one time Miniconda. However I can't get the two python versions to run along as I get a new set of problems depending on how I try. I have administrator rights on the computer. Second I would also like to be able to use another editor than SciTE for the pre-installed python 3.4.4.
There are a lot of threads on python environments but no solutions I can find that works for me, possibly because I'm not allowed to touch or change my first "environment/installation". I've worked on a solution from the Command Prompt, Anaconda Prompt and also used following editors: SciTE (which comes pre installed with Plaxis software), PyCharm and Spyder.
What I've tried so far and what happened:
Estimated quick fix: Updated pre-installed python 3.4.4 and added some new modules in
C:\Program Files\Plaxis\PLAXIS 2D\python\...
., but then I could no longer use the provided software module plxscripting which is essential. Conclusion: I should never interfere with this python version or its libraries.Download Anaconda3: When downloading Anaconda3 and was asked, I added Anaconda to system path environment variable with the result that neither Anaconda Navigator nor Spyder did start. When running the Anaconda Prompt it looked like this
>conda info
ImportError: DLL load failed: The specified module could not be found.
The pre-installed python 3.4.4 still worked as before when run from SciTE-editor.
The PYTHONPATH was set towards Plaxis-version and the PATH included both locations for Plaxis-version and Anaconda-version as below.
C:\WINDOWS\system32>set PYTHONPATH
PYTHONPATH=C:\Program Files\Plaxis\PLAXIS 2D\python\Lib\site-packages\plxscripting;C:\Program Files\Plaxis\PLAXIS 2D\python\Lib\site-packages
C:\WINDOWS\system32>set PATH
Path=C:\Anaconda3;C:\Anaconda3\Library\mingw-w64\bin;C:\Anaconda3\Library\usr\bin;C:\Anaconda3\Library\bin;C:\Anaconda3\Scripts;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Common Files\Rasterex Shared\\Raster Filters;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Plaxis\PLAXIS 2D\python\plxpy;C:\Program Files\Plaxis\PLAXIS 3D\python\plxpy;C:\Users\mdt\AppData\Local\Microsoft\WindowsAppsPATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
After reading more about PYTHONPATH I emptied it. Then Anaconda Navigator and Spyder could start, but when I tried to import modules as numpy or checked help('modules')
to list available modules I got fatal error
.
From Anaconda Prompt I could find two versions of python
(base) C:\Program Files\Plaxis\PLAXIS 2D\python>where python
C:\Program Files\Plaxis\PLAXIS 2D\python\python.exe
C:\Anaconda3\python.exe
When I started python 3.4.4 from the Anaconda Prompt I could get hold of the modules which where in
(base) C:\Program Files\Plaxis\PLAXIS 2D\python>python
Python 3.4.4 |Continuum Analytics, Inc.| (default, Feb 16 2016, 09:54:04) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import plxscripting
>>> sys.prefix
'C:\\Program Files\\Plaxis\\PLAXIS 2D\\python'
>>> site.getsitepackages()
['C:\\Program Files\\Plaxis\\PLAXIS 2D\\python', 'C:\\Program Files\\Plaxis\\PLAXIS 2D\\python\\lib\\site-packages']
but when I started Spyder and picked python version 3.6 the sys.prefix and getsitepackages() were directed to the same Plaxis-folder as above. When I changed the Spyder interpreter to Plaxis-python 3.4 it couldn't start the kernel.
From the Windows command prompt only the Anaconda-version was found and the sys.prefix was directed towards Anaconda.
(base) C:\WINDOWS\system32>where python
C:\Anaconda3\python.exe
(base) C:\WINDOWS\system32>python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import plxscripting
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'plxscripting'
>>> sys.prefix
'C:\\Anaconda3'
>>> site.getsitepackages()
['C:\\Anaconda3', 'C:\\Anaconda3\\lib\\site-packages']
At one point here I updated several libraries in the Plaxis-folder which removed many important connections so I had to reinstall the software. I have also done some iterations of installations (clean install).
Once along the way I manually set Advanced System Settings -> Environment Variables -> Edit Path -> New to Anaconda3 and Anaconda3/Scripts (according to 'Conda' is not recognized as internal or external command) . It didn't help.
- I have tried adding the whole pre-installed python folder to a virtual environment. Then there was an error with dll-files again as in the beginning of nr 2 above, and I couldn't run python 3.6.
If anyone could help me it would be greatly appreciated, I've worked on this back and forth for about 6 months and read everything I could find... I guess the solution is to have two environments completely separated and then be able to chose active environment in my preferred editor. But somehow it doesn't work. Any constructive thoughts appreciated!