DyadyaGenya
DyadyaGenya

Reputation: 21

Portable VS Code + portable Python

I am new to learning Python and VS Code. Tried to make portable python version from embeddable version. Deleted the python._pth file, and tried to install python get-pip.py. But nothing happens. I did it by analogy by downloading the full installation distribution. Installed, copied the folder to the desired drive, deleted the installed one. Python starts up. But at least with the help of VS Code, at least by itself, it installs the libraries to the user's folder on the system drive along the path C:\Users\username\AppData\Roaming\Python\Python39
Naturally, when I run Python on another computer, there are no libraries installed In addition, if I do not set two directories in Windows PATH for Python itself and scripts, then many libraries also do not work. I need to go into the scripts folder and install the same pip from there. Maybe you need to somehow prescribe where to put it during installation? But how? Something like @ScriptDir I also write the following lines in settings.json:

"python.defaultInterpreterPath": "f:\\portable\\winpython3-9\\python.exe",
"python.defaultInterpreterPath": "d:\\portable\\winpython3-9\\python.exe",

Then Python works. Though libraries all the same puts in the directory of the user. But VS Code writes a warning that there are duplicate lines in the settings.json file. How can I replace these lines so that I don't have to repeat them for every drive? And how to make the libraries installed in the directory with Python? And what other ways are there to solve the problem of working together portable VS Code + portable Python

Upvotes: 0

Views: 5576

Answers (1)

DyadyaGenya
DyadyaGenya

Reputation: 21

Solved this problem. I found a portable Python here at this link. http://winpython.github.io/ Just downloaded the installation (ziped)file. Then in VS Code I specified the path to the interpreter and everything works. Nothing needs to be written in settings.json

Upvotes: 1

Related Questions