After I have run
anaconda-project add-packages python=3.5
there downloaded some dependencies.
Where those downloading locate in? and How could I delete those files by anaconda command line?
If you had created a virtual environment, then you can find the location of the packages by
$ echo $VIRTUAL_ENV
The packages are stored inside lib/ directory. You can delete the files manually or use conda remove --force
The real problem here is, anaconda-project run under a installed env, it will install the absent packges in this env by default.
Related
I tried to create virtual environment using pyenv virtualenv 3.8.2 myenv, but it failed, i don't know why, i even changed the python version or the virtual environment name, but it still not working.
Some detail:
I tried this in macos and zsh.
➜ ~ pyenv virtualenv 3.8.2 myenv
Looking in links: /var/folders/_9/l8m14fgs6ts9wx0nl1qbzbkm0000gn/T/tmpe9l25o2_
Requirement already satisfied: setuptools in /Users/fitz/.pyenv/versions/3.8.2/envs/myenv/lib/python3.8/site-packages (41.2.0)
Requirement already satisfied: pip in /Users/fitz/.pyenv/versions/3.8.2/envs/myenv/lib/python3.8/site-packages (19.2.3)
rm: /Users/fitz/.pyenv/shims/shims: is a directory
➜ ~ pyenv versions
system
3.7.3
* 3.8.2 (set by /Users/fitz/.python-version)
3.9.5
I had the same issue. For me it was caused by two empty folders in my shims directory. I deleted the folders and it fixed the issue. So, just running the following would fix your issue.
rm -rf ~/.pyenv/shims/shims
rm -rf ~/.pyenv/shims/versions
Try using 'venv' instead of pyenv or pyvenv or virtualenv. Venv is a library that already comes with your python installation. Virtualenv is an external one.pyenv is similar to venv in that it lets you manage multiple python environments. However with pyenv you can't conveniently rollback library installs to some start state and you will likely need admin privileges at some point to update libraries. So I think it is also best to use venv.
First, make a directory :
mkdir testing
Then, moved to this directory named testing :
cd testing
When you type following command in this directory:
python3 -m venv env
You got error like :
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
Type the following command but before that keep an eye on the version of python you installed on the machine; in my case its python3.8
sudo apt install python3.8-venv
Now, we can create a virtual environment and store its tools in the "bhandari" folder .
python3 -m venv bhandari
Note: you can named this "bhandari" folder; anyname you like( Standard practice is to name it "env" ...)
Now to activate your virtual environment, from the directory of your folder, type the following command this will activate our virtual environment in the “bhandari” folder
source bhandari/bin/activate
If you have successfully activated your virtual environment, you should see the (bhandari) word indicating that we are working in a virtual environment.
After this, we can install anything that will be isolated from the rest of the system....
I installed poetry to windows using get-poetry.py. I cloned the entire poetry-master folder from the github to my desktop, unzipped it, then ran the install file. It asked me if I would like to modify something but responding both yes and no didn’t allow me to input any addiditonal information. The .poetry file ended up in my user directory. (Ex: C:\Users\CursedDog19\ .poetry)
I need poetry to install a package from GitHub for testing but my install of poetry only runs from one directory (\ .poetry\bin) Poetry claims to run from all directories.
To install to my own directory I can use
pip install --user package
Alternatively I can use
conda install package
How do I ask conda to install to my home directory since conda does not take a --user flag?
Installing pip packages to $HOME folder
I don't think it's possible. Use virtual environments (conda create).
See -p option here:
-p PATH, --prefix PATH
Full path to environment prefix.
So to install to, say, local under your home directory, do:
conda install -p $HOME/local packagename
Note, however, this is not a "clean" install as it adds a bunch of conda-related files.
To install conda packages on your own directory you can follow these steps:
Create a blank environment
conda create -y -n my-conda-env
Replace the name my-conda-env with any name you want to give the environment.
Activate the environment
source activate my-conda-env
Don't forget to replace my-conda-env with the name you gave the conda environment from the previous step
Install your package
conda install -c bioconda epa-ng
And that's it, the package should be installed on your own directory
Simply:
sudo conda install -c conda-forge package
Or:
sudo chmod -R 777 ./
conda install -c conda-forge package
I don't know of an exact match for the --user flag, but a reasonable analogue is to use a virtual environment.
What I do when I have to install to a shared CentOS server where I don't have admin access:
First I run
conda env list
will list all conda virtual environments and display the path to each. Once you have the environment created and can see it in the conda env list, copy the path to the environment.
If you need to create one, you can do that with conda create or by running anaconda-navigator and using the GUI.
Activate your environment (if not active) with
conda activate [environment_name]
or
activate [environment_name]
depending on your system (most linux systems use the first, Windows and CentOS use the latter).
Now you can use
conda install -p [environment_path] [package_name]
and you are off to the races.
This is really a work around; it's not the best but it does install the package to the selected virtual environment.
The current Anaconda Install Individual Edition, when run in a linux local account, installs in a local directory. So all the subsequent installs should install there, too.
According to the documentation:
--use-local
I've downloaded Cygwin here( setup-x86_64.exe). I have chosen to install from local directory.
Root directory: C:\cygwin64 . Local package directory: C:\Users\hp\Downloads. And there's no packages to install. How do I fix this? mintty.exe does not exist on my bin folder.
When you choose “Install from Local Directory”, Cygwin will try to pull packages
from your cache. In my case, my cache is:
C:\ProgramData
My mirror is:
http://cygwin.mirror.constant.com/
and my packages can be found:
C:\ProgramData\http%3a%2f%2fcygwin.mirror.constant.com%2f\x86_64\release
C:\ProgramData\http%3a%2f%2fcygwin.mirror.constant.com%2f\noarch\release
Unless you have stuff there, you will be unable to install anything. Better
option is to choose “Install from Internet”. This will download
packages if needed.
I installed python environment by means of commands:
SYS_INSTALL="apt-get install -y"
PIP_INSTALL="pip install"
# Be sure to install setuptools before pip to properly replace easy_install.
$SYS_INSTALL git
$SYS_INSTALL python-dev
$SYS_INSTALL python-setuptools
$SYS_INSTALL python-pip
$PIP_INSTALL virtualenv
also was able to create new virtual environment:
virtualenv .env
However, after running a command like:
. .env/bin/activate
I got
-bash: .env/bin/activate: No such file or directory
After reviewing folder .env/bin I found only one python file. Whole list of files here:
.env/lib:
python2.7
.env/include:
python2.7
.env/bin:
python
What is the issue here?
SOLUTION add --always-copy
virtualenv .env --always-copy
For me it works when I do these steps:
Go to the directory/folder that you want
run virtualenv .env
then run source .env/bin/activate
The accepted answer is incomplete! The suggested code left out your error, but didn't comment on it.
The command . .env/bin/activate would indeed do the same as source on the file activate in the folder .env/bin. In fact, apparently the command "source" is an alias for the command ".", and not the other way around. Note that . here has a space after it, and used differently from the . discussed below (which makes files and folders hidden).
What I notice is that you are calling your folder .env, which is not standard practice. Files and folders preceded by . are made "hidden" by Mac OS X. Standard practice is to call a virtual environment directory env or venv, and to call the virtual environment specification file .env.
So, if your spec file is called .env and your virtual environment directory is called env, you can run either
source env/bin/activate
or
. env/bin/activate.
I had the same issue and the following steps resolved it:
$mkdir annotateNLP
$cd annotateNLP
$python -m venv env
$source env/Scripts/activate
Try these commands in the terminal:
$ mkdir djangoapp
$ cd djangoapp
$ python3 -m venv myvenv
$ source myvenv/bin/activate
You can't go straight into activate command without first creating your virtual environment.
you forgot to include source before activating command is
source env/bin/activate
this question is similar to your's
virtualenv is not compatible with this system or executable
where it creates virtualenv but,python file instead of activate in bin
After going to your virtual environment folder .\Scripts\activate.
In my case, I need to install
sudo apt-get install python3-venv
$ virtualenv env
$ cd env/Scripts/
$ . activate
I was facing this same issue. I uninstalled the virtualenv in Ubuntu and then I installed it again. After this nonsense, it works and now I am able to activate my virtualenv through -$source py3/bin/activate.
If installed venv on a Windows machine, run this command (assuming you are in the working directory that has your venv folder):
In bash terminal: source venv/Scripts/activate
In cmd terminal:
venv\Scripts\activate
where venv is the folder name for your virtual environment
For windows using git bash, run the below command:-
source env\Scripts\activate