Jul-26-2020, 12:53 AM
Lets start at the beginning.
Awhile back I started taking an interest in Python, and began to build a Python37 system in C:\Python37.
Then I had heard of Anaconda(3.7), and installed it also. I had thought at the time Anaconda was simply an extension of C:\python37.
The result was pip was first installing into C/Python37, and then into the Anaconda.
To complicate matters, they were both sharing the same --users directory under ROAMING, \Python37.
However, there were no apparent problems caused by this. I simply started installing and updating everything with --users.
This is not a particular problem as I have not started any projects which might be versison specific.
But.. Problems came. The first time it was the result of a hibernation program which BSODd and messed up a bunch of files in the shared --users dir.
But I was able to track down the errors, and reinstall the dozen or so affected modules. Out of around 5000.
Everything resumed to working again.
I renamed pip and Python.exe so as to clearly differentiate the two in my path statement. They were coexisting fine.
Then a second problem occurred. I had left the machine on during a hot day, and turned the fan off when going out for the day. On arrival the machine was quite frozen
and required a cold reboot. Problems. Soft errors on about a dozen problems and a low level tester showed 100% OK. But *something* was messing with the Python37 install as I
found when switching directories around. I copied over a mirror install (albeint with less modules) from another machine, and all seems to be working.
BUT...
Somewhere along the line of testing I moved the --users site dir (Roaming\Python37\site-packages ) out of the way to see if the error was there. It
persisted, and then I moved it back.
HOWEVER...
It had created a *NEW* --user dir in ROAMING\Python\Python37\site-packages, and set the path to it on BOTH Anaconda and Default python installs.
It also changed the directory structure on the new users directory. Scripts, libs, that sort of thing.
I no longer had access to thousands of installed modules!
The error I was encountering before I switched things around was a null bytes error, but absolutely nothing was pointing to an aberrant file. Pip would ownload the install file, write it out to /TEMP but never get further. I reinstalled pip, setuptools, pkginfo, and anything similar I could find.
The *problem* is that I would like to get my old --user directory back, but
I would like to be able to manipulate my python path in a permanent manner.
I am a bit leery about using an environment variable as the space for them is about used up, with all the packages and tools I have on this machine.
I have symlinked a bunch of paths just to fit everything!
So: to simplify -
I need a means of changing PYTHONPATH thats 'sticky'.
I also need guidance for useful logging. Adding a logging file to pip only told me to check the logs at the point of failure I was experiencing, with no reference to the troublesome module causing the NULL BYTE error.
Awhile back I started taking an interest in Python, and began to build a Python37 system in C:\Python37.
Then I had heard of Anaconda(3.7), and installed it also. I had thought at the time Anaconda was simply an extension of C:\python37.
The result was pip was first installing into C/Python37, and then into the Anaconda.
To complicate matters, they were both sharing the same --users directory under ROAMING, \Python37.
However, there were no apparent problems caused by this. I simply started installing and updating everything with --users.
This is not a particular problem as I have not started any projects which might be versison specific.
But.. Problems came. The first time it was the result of a hibernation program which BSODd and messed up a bunch of files in the shared --users dir.
But I was able to track down the errors, and reinstall the dozen or so affected modules. Out of around 5000.
Everything resumed to working again.
I renamed pip and Python.exe so as to clearly differentiate the two in my path statement. They were coexisting fine.
Then a second problem occurred. I had left the machine on during a hot day, and turned the fan off when going out for the day. On arrival the machine was quite frozen
and required a cold reboot. Problems. Soft errors on about a dozen problems and a low level tester showed 100% OK. But *something* was messing with the Python37 install as I
found when switching directories around. I copied over a mirror install (albeint with less modules) from another machine, and all seems to be working.
BUT...
Somewhere along the line of testing I moved the --users site dir (Roaming\Python37\site-packages ) out of the way to see if the error was there. It
persisted, and then I moved it back.
HOWEVER...
It had created a *NEW* --user dir in ROAMING\Python\Python37\site-packages, and set the path to it on BOTH Anaconda and Default python installs.
It also changed the directory structure on the new users directory. Scripts, libs, that sort of thing.
I no longer had access to thousands of installed modules!
The error I was encountering before I switched things around was a null bytes error, but absolutely nothing was pointing to an aberrant file. Pip would ownload the install file, write it out to /TEMP but never get further. I reinstalled pip, setuptools, pkginfo, and anything similar I could find.
The *problem* is that I would like to get my old --user directory back, but
import sys sys.path.append("C:\\Users\\Administrator\\AppData\\Roaming\\Python37\\site-packages")Only seems to work in a python shell, and not at all in 'Python -c' command line mode.
I would like to be able to manipulate my python path in a permanent manner.
I am a bit leery about using an environment variable as the space for them is about used up, with all the packages and tools I have on this machine.
I have symlinked a bunch of paths just to fit everything!
So: to simplify -
I need a means of changing PYTHONPATH thats 'sticky'.
I also need guidance for useful logging. Adding a logging file to pip only told me to check the logs at the point of failure I was experiencing, with no reference to the troublesome module causing the NULL BYTE error.