Closed niharbabu99 closed 1 year ago
looks like a typo in the instructions, try "python3 -m venv .venv" instead.
looks like a typo in the instructions, try "python3 -m venv .venv" instead.
I see same error even with the above command.
Some microsoft strangeness going with that ensureip thing, perhaps you need to pip install it?
This is what I get:
git clone https://github.com/aws-samples/bulk-policy-migrator-scripts-for-account-cost-billing-consoles.git Cloning into 'bulk-policy-migrator-scripts-for-account-cost-billing-consoles'... remote: Enumerating objects: 135, done. remote: Counting objects: 100% (135/135), done. remote: Compressing objects: 100% (105/105), done. remote: Total 135 (delta 78), reused 75 (delta 29), pack-reused 0 Receiving objects: 100% (135/135), 47.92 KiB | 732.00 KiB/s, done. Resolving deltas: 100% (78/78), done. cd bulk-policy-migrator-scripts-for-account-cost-billing-consoles ls CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE policy_migration_scripts README.md requirements.txt python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt Collecting boto3 Downloading boto3-1.28.56-py3-none-any.whl (135 kB)
Looks like it is because of this
ensurepip is disabled in Debian/Ubuntu for the system python.
running a command python3 -m venv venv --without-pip
helped. On ubuntu or debian machines we need to use this command.
Up and running?
Up and running?
Yes
@niharbabu99 - Glad you have it up and running.
I spun up an ubuntu instance (20.04 LTS) which comes with Python 3.8.10 pre-installed. I ran the command: python3 -m venv venv
. I got the below error:
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.8-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
So I had to install this package by running sudo apt install python3-venv
. Once I installed this package, I re-ran the command: python3 -m venv venv
and this worked.
I will update the README with this extra command specifically for ubuntu.
However I noticed one problematic issue in the screenshot you shared - You seem to be using Python 2.7, which is not the recommended version for running these scripts. As you can see in the Prerequisites, we recommend using Python 3. Please upgrade your python version, create a new venv
using Python 3 and then run the scripts.
These scripts are not built to run with Python 2
@niharbabu99 - Glad you have it up and running.
I spun up an ubuntu instance (20.04 LTS) which comes with Python 3.8.10 pre-installed. I ran the command:
python3 -m venv venv
. I got the below error:The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command. apt install python3.8-venv You may need to use sudo with that command. After installing the python3-venv package, recreate your virtual environment.
So I had to install this package by running
sudo apt install python3-venv
. Once I installed this package, I re-ran the command:python3 -m venv venv
and this worked.I will update the README with this extra command specifically for ubuntu.
However I noticed one problematic issue in the screenshot you shared - You seem to be using Python 2.7, which is not the recommended version for running these scripts. As you can see in the Prerequisites, we recommend using Python 3. Please upgrade your python version, create a new
venv
using Python 3 and then run the scripts.These scripts are not built to run with Python 2
Yes, you are right, command I used is wrong. Later I realized and ran command pip3 install -r requirements.txt
, post which I am able to use the scripts.
I followed the steps and when I executed the command
python3 -m venv venv
it failed with an errorError: Command '['/mnt/c/WORK/projects/bulk-policy-migrator-scripts-for-account-cost-billing-consoles/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
When I tried running the command manually
venv/bin/python3 -Im ensurepip --upgrade --default-pip
it threw an errorbulk-policy-migrator-scripts-for-account-cost-billing-consoles/venv/bin/python3: No module named ensurepip
can some help me on how to fix this.
System Details Ubuntu 18.04 Bionic It is installed on a Windows with WSL 1.0
Python Version is 3.9.16