0

I've never used Python, I don't program, so I know less than nothing.

Yet, that being said, I've been messing around with it while working on a program that has plugins, scripts and which uses many other programs in its process to function.

Being I knew nothing of Python, I made many mistakes, and I started getting errors. After trying to fix my Python issues I ended up opting for uninstalling and reinstalling everything (all Python installations).

My issue involves the python -m site --user-site command which I found by reading this post. This post's topic seems to be the issue I need to resolve, yet it was asked by someone on a Mac, and a lot of the information doesn't apply to me.

The directory that is returned by this code is one that doesn't exist for me anymore. It points to C:\Users\<Username>\AppData\Roaming\Python\Python310\site-packages and while I have a 3.7 and 3.9 Python here, I don't have a 310.

Following the thread I linked, someone suggests using the directory that code points to, creating the missing directories, then creating a .pth file that includes the path where it should go. This response got a lot of feedback with everyone stating that it worked for them.

I created my example.pth and on the top line, I put what I considered to be the only logical directory, which is the correct site-packges folder where my Python310 is installed. I assumed the empty directory was used by my old 310 installation, and my program still holds its location somewhere, pointing it there.

After doing all of this, I ran that code again, python -m site --user-site but it still points to that same folder location.

My example.pth file, has only the one line below in it:

"C:\Program Files\Python310\Lib\site-packages"

I try not to ask many questions here, and search for hours trying to figure it out on my own, but I don't know if it's something small, where I need to change just one thing, or if it's a lot more complicated. I tried to explain everything in as much detail as I could.

  • Did you try changing `Path` system environment variable to point to other Python versions? I haven't done changing Python's path on Windows, but I guess there must be something like `%appdata%\Python\Python310\` string – sudden_appearance Feb 13 '22 at 00:24
  • I've only done what I have described, I don't know how to do that unless you are talking about adding a new path in my Environment Variables. If so, all Python installations are System Variables, which I did on the install. Also, everything with Python has been done with the 310 version, I haven't added or done anything with the others except install. – EngineerJack Feb 13 '22 at 01:23
  • I was reading through that post I linked, and I read a few times, how we need to make sure the path we point to has the init.py file at the very top of the directory structure. This may be for Mac & Linux, as I don't remember ever seeing that file in windows. Asclepius in the 2nd post states, to add a directory permanently (on Mac & Linux) add `export PYTHONPATH="${PYTHONPATH}:/my/other/path"` to the ~/.bashrc. On Windows, it's through the Environment Variables. What would be the Windows version of init.py? I'm guessing the config.py? That's what makes the most sense to me. – EngineerJack Feb 13 '22 at 03:43
  • I keep coming back to this, as it seems like I am so close to resolving it, but I'm not figuring it out. I tried changing that path that I linked to the 3.7 and 3.9 Pythons, with and without parenthesis, and others. I don't know what I'm doing wrong. Is the example.pth wrong for Windows? Am I linking it incorrectly? Or is it the path I'm trying to use? How do I figure out where the path is supposed to go? I'm about done messing with this tonight, I can only take so much, and this has me to that point. – EngineerJack Feb 13 '22 at 06:03

0 Answers0