I recently ran the following command to install the Amazon Elastic Beanstalk Command Line Interface (EB CLI). I would now like to remove it from my Windows 10 machine.
C:\Users\Cale>pip install --upgrade --user awsebcli
What is the best command to run to ensure that its fully removed from my machine?
I was able to uninstall using the following command:
C:\Users\Cale>pip uninstall awsebcli
I was uncertain how to do the uninstall since I specified --user in the original install command. This stackoverflow article helped me understand that the --user option would not matter during the uninstall process.
How to uninstall a package installed with pip install --user
For me, the awsebcli is not present in the pip list command that references the $PATH. I get this error:
Skipping awsebcli as it is not installed.
Apparently, it's on the pip executable(s) in this location (Windows, PowerShell format):
$env:userprofile\.ebcli-virtual-env\Scripts\
The uninstall command worked properly using one of those executables.
After that, it it seems that deleting the .ebcli-virtual-env will remove it fully from the machine: How do I remove/delete a virtualenv? (disclaimer: I'm not a pythonista :) )
Related
I am trying to run below commands but it's not working on my windows machine.
C:\Users\XXX\Desktop\python-7>pip install chalice -t .
ERROR: Can not combine '--user' and '--target'
C:\Users\XXX\Desktop\python-7>pip install --user --install-option="--prefix=" chalice -t .
ERROR: Can not combine '--user' and '--target'
Can someone please let me know if there is any alternative to get the module in the same directory ?
UPDATE
C:\Users\XXX\Desktop\python-7>pip install --target=C:\Users\XXX\Desktop\python-7 chalice
ERROR: Can not combine '--user' and '--target'
add --no-user at the end of the command and it should work
This happens with the Python version distributed on the Windows AppStore.
I believe it's because that version installs the basic executables under C:\Program Files\WindowsApps, a secured location that users cannot modify; pip is then aliased to actually run as something like pip --user C:\Users\<your_user>\AppData\Local\Packages\PythonSoftwareFoundation.Python.<version>_<id>\LocalCache\local-packages\Python<version>, so users will install packages to a writeable folder.
Hence, as soon as you try to add --target, pip breaks.
You can simply use:
C:\Users\XXX\Desktop\python-7>pip install chalice
Unable to run the rasa init command and getting following error:
'rasa' is not recognized as an internal or external command, operable program or batch file.
I have following version of RASA in my environment:
rasa-core 0.13.2
rasa-core-sdk 0.12.2
rasa-nlu 0.14.6
rasa-sdk 1.2.0
Sams answer is right. Rasa is probably not in your environment variable path.
Have you already tried:
py -m rasa init
or
python -m rasa init
If this doesn't work you may find answers at the rasa community forum
Did you try pip based installation as mentioned here
You can do
pip install rasa
If you have already done that I suspect that you need to add rasa in the environment variable PATH
Also are you using virtualenv? or conda environment? I would suggest using that to do the installation.
I had this issue with python 3.9. It worked after downgrading the python version to 3.8. It required recreating my conda environment.
Hopefully you got it working by now, but if not you can either
1) Try setting the Python path in Advanced System Settings > Environment Variables. (ideally we want it in a top-level folder)
2) Re-install Python using the graphical installer. Run the regular Python installer as administrator. BE SURE to click the little ‘Add to PATH’ checkbox, or all this will be for naught!! (For me personally this is a lot easier than manually adjusting the path in environment variables.)
Then choose “Custom install location.” Clicking “Install for all users” should automatically change the install path to the C:Program Files folder.
3) You may also be able to do this without a full reinstall by selecting Programs > Programs and Features > Modify/Repair.
Go to Settings -> Manage App Execution Aliases -> Turn Python Off - since I had both Python and Python3 enabled, the VSCODE was not letting me access the virtual environment I created in the Project Folder. This solved my issue.
Wrong Path in cmd Terminal of VSCODE:
C:\User....\Project>rasa --version
'rasa' was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Correct Path in cmd Terminal of VSCODE (after turning off Python in Computer App Settings):
(venv) C:\User....\Project>rasa --version
Rasa Version : 2.3.4
Rasa SDK Version : 2.3.1
Rasa X Version : 0.37.1
Python Version : 3.7.10
The accepted answer says to set the environment variables which made me curious but the problem is I do not know the rasa installation path to set the environment variables.
Step 1:
So I'll write down how I figured this out. First, if you don't have the Anaconda package manager install it from the official website. (While installing click the checkbox to add Anaconda to your PATH environment variable.)
Step 2:
Now open up the anaconda prompt and go to the directory where you want to run rasa.
Step 3:
Then we can create a new conda environment by running conda create --name installingrasa python==3.8.5 to keep all of our dependencies together in a centralized place. Finally activate the environment by conda activate installingrasa
Step 4:
Install UJSON and Tensorflow that will help us to work with rasa.
conda install ujson
conda install tensorflow
Step 5:
Ultimately we can install rasa. Here we are going to install it via pip rather than conda. (there is no conda version fr rasa at the moment I'm writing this)
pip install rasa
Step 6:
In order to run Tensorflow on windows, we need to download visual c++ separately. Find the executable from the official website. And now we can run rasa init without errors and initialize new bot.
try this code while creating a virtual environment
conda create --name filename python==3.8
Looks like this is an issue of python 3.9. After playing around a lot with 3.9, I downgraded my python to 3.8 and it worked without a glitch.
You can create a conda environment with a different python version by using the option python==3.8 in the conda create command line.
The above solutions didn't worked for me.
After a lot of searching I found that rasa was located at C:\Users\tejas\AppData\Roaming\Python\Python36\Scripts\rasa.py (installed using pip install rasa)
As I was working anaconda environment named as(RASA)
I didn’t found rasa.py at C:\Users\tejas\anaconda3\envs\RASA\Scripts nor in
C:\Users\tejas\anaconda3\Scripts
So I just copy pasted rasa.py at these 2 locations and it worked for me in anaconda environment.
You might forget to install the rasa package. You can follow the steps to install rasa on your machine.
Create a new virtual environment named venv
You can also install rasa without virtual environment. but it would be better to track the dependencies if we are in a virtual environment.
python3 -m venv venv
Activate the virtual environment
For windows: venv\Scripts\activate
For Ubuntu: source ./venv/bin/activate
Install rasa package
pip3 install -U pip
pip3 install rasa
For more: Rasa installation
Try this command,
pip3 install -U --user pip && pip3 install rasa
It worked for me, This command will upgrade your pip to the latest version, and rasa will be successfully installed, and check it by typing rasa --version.
If it still doesn't work, download the python 3.7 version using miniconda,set the environment using miniconda, and then install rasa using this command again
Just started using docker.
I want to install numphy, scipy etc from bash
i.e
PS H:> docker run -it python:3.4 bash
then
....:/# install requests
....:/# pip install numphy
I'd expect this to work but for some reason I get the error:
Could not find a version that satisfies the requirement numphy (from versions: )
No matching distribution found for numphy
Not really sure what to do from here - any help would be most appreciated.
Are you trying to install numpy? You need to use:
pip install numpy
Not:
pip install numphy
That package (numphy) isn't found because it doesn't exist. You either misspelled it as noted or you don't have the files (if it's a package you'r developing locally) inside the container to install it.
I have installed some packages with -e
> pip install -e git+https://github.com/eventray/horus.git#2ce62c802ef5237be1c6b1a91dbf115ec284a619#egg=horus-dev
I with pip freeze I see
> pip freeze
...
-e git+https://github.com/eventray/horus.git#2ce62c802ef5237be1c6b1a91dbf115ec284a619#egg=horus-dev
...
when I try to uninstall the packages I get errors:
> pip uninstall horus-dev
Cannot uninstall requirement horus-dev, not installed
> pip uninstall horus
Cannot uninstall requirement horus, not installed
How do I uninstall such a package?
At {virtualenv}/lib/python2.7/site-packages/ (if not using virtualenv then {system_dir}/lib/python2.7/dist-packages/)
remove the egg file (e.g. distribute-0.6.34-py2.7.egg) if there is any
from file easy-install.pth, remove the corresponding line (it should be a path to the source directory or of an egg file).
An easier way to do the same with the new version of setup_tools is to run the following:
python setup.py develop -u
Which basically does the same as what #glarrain describes in his answer.
Here's a demonstration, showing that eg you don't want to substitute a package name into that command:
.../pytest-migration$ python setup.py develop -u
running develop
Removing /home/me/virtualEnvs/automation/lib/python2.7/site-packages/pytest-migration.egg-link (link to .)
Removing pytest-migration 1.0.155 from easy-install.pth file
.../pytest-migration$
Install a dev package use cmd:
pip install --editable .
Uninstall:
rm -r $(find . -name '*.egg-info')
Now you can use:
pip uninstall package_name
or python setup.py develop --uninstall or python setup.py develop -u
Simply uninstall the package you installed in 'editable' mode:
pip uninstall yourpackage
it works for recent pip-versions (at least >=19.1.1).
It turns out that my installation was somehow corrupt.
I could find the entry in:
/usr/local/lib/python2.7/site-packages/easy-install.pth
To solve the problem I removed the line in the .pth file by hand!
import sys; sys.__plen = len(sys.path)
...
/absolute-path-to/horus # <- I removed this line
...
This is a bug on debian/ubuntu linux using OS-installed pip (v8.1.1 for me), which is what you'll invoke with sudo pip even if you've upgraded pip (e.g. get-pip.py). See https://github.com/pypa/pip/issues/4438
For a discussion on how to clean up see https://askubuntu.com/questions/173323/how-do-i-detect-and-remove-python-packages-installed-via-pip, though the solutions there are of the "remove everything" variety.
...pip packages [go] to /usr/local/lib/python2.7/dist-packages, and apt packages to /usr/lib/python2.7/dist-packages
...a few packages were installed in ~/.local/lib too.
For my system all I needed to remove was /usr/local/lib/python2.7/dist-packages/{package_name}.egg-link
I think I have something to add to all the answers here:
Using pip list you'll see all your installed packages, and there is a little trickery: a single pip install can create several entries in this list. In particular when you do an editable install, you'll have your <package_name> listed besides the location of the source on your disc.
This <package_name> is only used for pip and is never called in python as far as I understand, it is configured in your pyproject.toml, setup.cfg or setup.py.
Thus, to properly uninstall your package using pip, you should use this name and not the named of individual modules included in your package.
Hope it helps!
I'm trying to install psycopg2 so I can use PostgreSQL in Python and Django. I have run into multiple errors in the last few hours trying to install it, and can't seem to solve the latest one. When I run:
setup.py install
on the psycopg2 in the command console it attempts to install it, but then gives an error when trying to execute link.exe in the Visual Studio 8 folder.
This doesn't make sense to me, considering I got that executable to work when I launch it from Windows Explorer, and from the command console. I even made an environment variable for it. However, it keeps giving:
"error: command C:\Program Files(x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe" failed with exit status 1120
In case anyone goes down this rabbit hole also, make sure your pip is up-to-date:
$ pip install -U pip
$ pip install psycopg2-binary
See: http://initd.org/psycopg/docs/install.html.
That's 3 hours of my life I won't get back.
Turns out this 3 and a half hour process I've been going through was unecessary. an exe installer of psycopg2 can be downloaded from here
Had the same problem.
Image of the error message
first run
sudo apt install libpq-dev python3-dev
then
pip3 install psycopg2
Go to https://pypi.org/project/psycopg2.
In release history select the version you want to download: there will be a table with files and compatible versions of Python.
Download the binary file that matches your system configuration.
For example, for Python 3.6 on Windows 10 (64-bit) download psycopg2-2.8.6-cp36-cp36m-win_amd64.whl.