I have install chcolatey but to install awscli i have given
command as:
choco install awscli ,and
out put is:
Cannot find file at '../choco.exe' (C:\ProgramData\chocolatey\choco.exe). This usually indicates a missing or moved file.
Related
I have installed Ansible on Ubuntu but it has installed it in the following directory:
/home/phill/.local/lib/python3.8/site-packages
rather than the expected /etc/ansible.
The command I used to install it was " python3 -m pip install --user ansible"
How do I get it to install in the /etc/ansible directory?
You don't want to "install" it to /etc/ansible. /etc is used for configuration files. You should read about the Filesystem Hierarchy Standard (FHS).
However, you can install ansible globally and create the /etc/ansible directory
sudo apt-get install ansible
I create a virtual environment with the command:
python -m venv ./my_venv
After activating this virtual env, I want to install some packages with .tar.gz archives.
My method to install my packages is explained in the following part:
PACKAGE1='/path/to/the/folder1'
PACKAGE2='/path/to/the/folder2'
PACKAGE3='/path/to/the/folder3'
PACKAGE4='/path/to/the/folder4'
pip install --find-links="${PACKAGE1}" package_1==1.0.0
pip install --find-links="${PACKAGE2}" package_2==1.0.0
pip install --find-links="${PACKAGE3}" package_3==1.0.0
pip install --find-links="${PACKAGE4}" package_4==1.0.0
Now I want to use a file requirements.txt like:
package_1==1.0.0
package_2==1.0.0
package_3==1.0.0
package_4==1.0.0
and run the command:
pip install --find-links="${PACKAGE}" -r requirements.txt
but
I don't find the way to tell pip to install using multiple folder.
Here is an example of what I want:
PACKAGE1='/path/to/the/folder1'
PACKAGE2='/path/to/the/folder2'
PACKAGE3='/path/to/the/folder3'
PACKAGE4='/path/to/the/folder4'
pip install --find-links="${PACKAGE1}" --find-links="${PACKAGE2}" --find-links="${PACKAGE3}" --find-links="${PACKAGE4}" -r requirements.txt
Obviously, I didn't work.
Can you help me ? :)
Have a look at the --find-links documentation again:
If a local path ... that’s a directory, then look for archives in the directory listing.
So /path/to/the/folder4 for example will need to contain an archive/wheel for package4. This will not work if /path/to/the/folder4 is just the source directory/root for package4.
I tried to install all dependencies in my requirements.txt (a bunch of packages list).
What I did:
created virtual env virtualenv my_env
activated the new virtual env, I'm able to see my virtual env before the prompt (my_env) $
ran pip install -r requirements.txt
All packages got installed, but when checking with pip freeze I have nothing. Tried to deactivate the virtual env, and made pip freeze again, here I have all installed.
I'm a bit confused because, I'm very sure my virtual env was activated, and I have the right pip path when doing which pip inside it (/home/virtual_env/my_env/bin/pip). Plus, I tried to install one by one the dependency, and they got installed right inside the virtual env & displayable with pip freeze
I cannot do all of them one by one, and I need to reproduce the installation somewhere. Could someone helps on this?
Still no clean solution for this so far, but what would work is to copy-edit (search & replace the return character in the requirements.pip to && pip install. Meaning, edit it from this format
package1==vX.Y
package2==vU.V
...
into this
package1==vX.Y && pip install package2==vU.V ...
Add pip install at the beginning then make a copy to all for install command like
pip install package1==vX.Y && pip install package2==vU.V ...
I installed AWS CLI from Python 2.7 using python -m pip install awscli. It seemed to install, but then when trying to run aws, I get 'aws' is not recognized as an internal or external command.
The documentation states that I should add to PATH this:
%USERPROFILE%\AppData\Local\Programs\Python\Python36\Scripts
But this is for Python3. Where is it installed for Python2? There is nothing in %USERPROFILE%\AppData\Local\Programs\ (I checked). And does installation work for Python2 or only for Python3?
After lots of searching, the file was located at c:\Python27\Scripts\aws.cmd. But it was aws.cmd, not aws.exe. So to make aws work, you need to add it to the PATH:
set PATH=%PATH%;c:\Python27\Scripts
After that it works:
c:\Python27>aws --version
File association not found for extension .py
aws-cli/1.11.148 Python/2.7.14rc1 Windows/10 botocore/1.7.6
Although there is still this weird File association not found for extension .py error.
Edit: From #zwer's comment about "File association not found for extension .py", you need to execute this from an administrator cmd prompt:
assoc .py=Python.File
ftype Python.File=c:\Python27\python.exe "%1" %*
The best approach to get this done is
Install pip
pip Install awscli
aws configure
keys and identification keys access parameters
To Install PIP:
need to update YUM Release version and then install python-pip
#yum install epel-release
#yum install python-pip
Install AWSCLI:
#pip install awscli
Configure AWSCLI:
#aws configure
aws_access_key_id=<########>
aws_secret_access_key=<####################>
Default Region[None]: region=us-west-2
format[none]: json
you can find these configuration parameters later in file::
~/.ssh/aws/credentials
I am trying to run some python script using ssh to log into the google compute engine but all the installed pip modules are not found as I do not have permission to the .cache/pip folder in my user is there a correct way to do this?
You should be running this with the root user.
Also, if you need pip inside your GCP Instance, you can use the following commands:
sudo curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py
[Source]
Use:
sudo apt-get install python3-pip
sudo runs this command as an administrator
apt-get is the standard package manager used on Debian Linux distributions
python3-pip is the package name for pip3
Once installed, you can install PIP modules with:
pip3 install MODULE_NAME
for example:
pip3 install tensorflow
I'm not entirely sure there is one correct way to do this, but an easy way would be to use the conda python package manager.
The lighter version of it is miniconda. You can get a minimal python installation with pip preinstalled, and virtual environments capability if you need. Assuming you are running on linux and want python 3, you'll have to run
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
and then install conda with
bash Miniconda3-latest-Linux-x86_64.sh
At the end of this process you should have a minimal python installation (that includes pip) and you'll be able to install packages with pip as you are used to.
You might want to install some basic libraries first -
sudo apt-get install bzip2 libxml2-dev
Then install miniconda as given by #teoguso and restart your shell
source ~/.bashrc
You can then use conda or pip to install your packages