-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Test microvenv
#21100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@karthiknadig it would have helped me to explain better how to setup my Linux VM as you want it for testing. While you make it very clear how it should be, I am not sure how to get there. I am running Ubuntu 22 and when I run this:
I see no error in the terminal: When I try to uninstall What steps need to be taken to be in an environment that can be used for testing? Would it be easier to share a docker container with testers that is setup exactly how you need it in the future? I think I am often hitting setup issues when I am assigned to Python test plan items, specifically because I never know how to install the correct environment. |
The intent of the TPI was to use OS images and containers that are available on the web. The reason is there are so many ways to install python and venv into an image that this would not serve the purpose of getting the variety. For example, this is the first time I have actually seen ubuntu image with I recommend using a plain debian image to test. |
Here is what you can do, to set up an image, where
|
If you use a base image with no python installed at all then you can try this:
|
Tested with Ubuntu (where it had venv but not pip) successfully but ran into a bug with Debian |
If you see error like |
Testing with Debian after installing distutils was successful |
It looks like the new python path isn't being added to the PATH properly after creating the environment... not sure if that's expected. Otherwise, worked well on Ubuntu 22.04. I did need to follow your steps to remove venv. |
@TylerLeonhardt if |
I have now tried to install a Debian parallels image which gave me Debian GNU Linux 10.10 and followed your steps to remove the However, I fail there to get Code to install even, because I miss a lot of dependencies, at least reported so by Since it is already late today, I yield for someone else to fill in my position. I seem unable to test this. |
I had to follow the same steps as Ben to remove venv from the default Python install in Ubuntu 18. However, I then got the following error:
Looked like my Python version was too old. This could probably be presented better, but no problem, I installed Python 3.11 from the deadsnakes PPA, and then followed the same instructions to remove venv from its install. I opened a new workspace folder just to make sure nothing bad was cached, but then hit this error after selecting the newly installed Python interpreter. It looks it's trying to run Python 3.6, but (a) I did not select Python 3.6 as my interpreter, and (b) it's trying to "run" /usr/include/python3.6, which is a directory (and doesn't have +x permissions, hence the error)
Unfortunately I could not try on my more modern Ubuntu VM due to microsoft/vscode#180843 Maybe someone else will have better luck, unassigning myself and putting this up for verification again |
Python 3.6 is not supported. Can you install python3.9 or 3.10? you can do |
@connor4312 The next best is to use WSL Ubuntu |
I got a devcontainer into the right starting state by manually deleting the venv module, but I get this error when running "Create Environment", does this mean it's not falling back on microvenv?
|
@roblourens |
Oh weird, I thought it installed pre-release by default on Insiders, guess not Edit- Actually I opened an issue for this scenario microsoft/vscode#180893 |
It worked, thanks |
@karthiknadig I did install and pick Python 3.11 in my second log, but it seems like the Python extension still tried doing stuff with Python 3.6 (or maybe those errors are extraeous) |
@connor4312 Python extension will try to detect all versions of python installed, and that can fail, but that is expected and should not impact working with 3.11 |
Refs: #20905
Complexity: 3
Create Issue
Requirements
You need a linux flavor derived from debian. Check the following before testing:
apt
package list should not have venv (python3-venv) or pip (python3-pip). You can test this by runningpython3 -c "import venv"
orpython3 -c "import pip"
. Both should fail.The intent of this TPI is to make sure we use
microvenv
(shipped with python extension) as fallback whenvenv
is not present. It should create a simplified version of the environment and should also installpip
into the environment. To verify this correctly, you must ensure that the OS you are using does not containvenv
orpip
pre-installed. For debian based OS these are often installed viaapt
, and they don't ship with them out of the box.Verification
<python-path> -c "import venv"
and<python-path> -c "import pip"
.venv
, and go through the flow.pip
, from the terminal in VS Code run:.venv/bin/python -m pip install pytest
.Notes
pip
is installed in the env. If you got an error while installing usingpip
that may not be related. Do report them here and I will let you know.The text was updated successfully, but these errors were encountered: