I am trying to execute pip install fastapi[all] but it is not working - api

I want to install Fast API to my mac by entering pip install fastapi[all], it errors.
kanta#Kantas-MacBook-Air fastapi % pip install "fastapi[all]"
zsh: command not found: pip
kanta#Kantas-MacBook-Air fastapi % pip install fastapi[all]
zsh: no matches found: fastapi[all]
kanta#Kantas-MacBook-Air fastapi % pip install fastapi[all]
zsh: no matches found: fastapi[all]
kanta#Kantas-MacBook-Air fastapi % pip install 'fastapi[all]'
zsh: command not found: pip
kanta#Kantas-MacBook-Air fastapi %
I think it is because I am using a mac. Is there a workaround?

You can reach pip via -m flag:
-m mod : run library module as a script (terminates option list)
python3 -m pip install "fastapi[all]"
Note: use python3 or any other alias for your version e.g. python3.10.
Also, I may recommend creating venv for your project.
python3 -m pip install virtualenv
python3 -m virtualenv venv
source venv/bin/activate
pip install "fastapi[all]"

Please try :
pip3 install 'fastapi[all]'

Related

Error intsalling tensorflow via pip install

WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an EnvironmentError: [WinError 2] The system cannot find the file specified: 'c:\python38\Scripts\chardetect.exe' -> 'c:\python38\Scripts\chardetect.exe.deleteme'
I was trying to install Tensorflow via command pip install tensorflow. and after downloading everything at the end found this error..can anyone tell me why this happened?
According to https://www.codegrepper.com/ you can use these two:
In Windows
python -m pip install -U pip --user
In Linux
pip install -U pip --user

Is Scrapy compatible with Python 3.8 on ubuntu?

While i am try to install scrapy on ubuntu mechine using
**pip install scrapy**
it's not going to workout.
can anyone suggest us?
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
In the documentation, it was mentioned that to install scrapy in a venv on ubuntu based os, we need to install these dependencies sudo apt-get install python3 python3-dev python3-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev

How to install Tensorflow federated directly from GitHub or local download?

I want to have access to features from TensorFlow federated (tff.python.research) which aren't present with the pip3 install method.
I'm working on a remote server that does not have bazel, thus I cannot build from source. Are there other ways to get and install the latest working version of TFF from its GitHub REPO?
(https://github.com/tensorflow/federated)
To install the latest Tensorflow 2.0 federated, you may follow the steps below.
Install TensorFlow Federated using pip
Install the Python development environment
On Ubuntu:
$ sudo apt update
$ sudo apt install python3-dev python3-pip # Python 3
$ sudo pip3 install --upgrade virtualenv # system-wide install
On macOS:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
$ brew update
$ brew install python # Python 3
$ sudo pip3 install --upgrade virtualenv # system-wide install
Create a virtual environment
$ virtualenv --python python3 "venv"
$ source "venv/bin/activate"
(venv) $ pip install --upgrade pip
Note: To exit the virtual environment, run deactivate.
Install the TensorFlow Federated pip package.
(venv) $ pip install --upgrade tensorflow_federated
(Optional) Test Tensorflow Federated.
(venv) $ python -c "import tensorflow_federated as tff; print(tff.federated_computation(lambda: 'Hello World')())"
Build the TensorFlow Federated pip package
Install the Python development environment.
On Ubuntu:
$ sudo apt update
$ sudo apt install python3-dev python3-pip # Python 3
$ sudo pip3 install --upgrade virtualenv # system-wide install
On macOS:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
$ brew update
$ brew install python # Python 3
$ sudo pip3 install --upgrade virtualenv # system-wide install
Install Bazel
Install Bazel, the build tool used to compile Tensorflow Federated.
Clone the Tensorflow Federated repository.
$ git clone https://github.com/tensorflow/federated.git
$ cd "federated"
Create a virtual environment.
$ virtualenv --python python3 "venv"
$ source "venv/bin/activate"
(venv) $ pip install --upgrade pip
Note: To exit the virtual environment, run deactivate.
Install Tensorflow Federated dependencies.
(venv) $ pip install --requirement "requirements.txt"
(Optional) Test Tensorflow Federated.
(venv) $ bazel test //tensorflow_federated/...
Create a new project.
$ mkdir "/tmp/project"
$ cd "/tmp/project"
$ virtualenv --python python3 "venv"
$ source "venv/bin/activate"
(venv) $ pip install --upgrade pip
Note: To exit the virtual environment run deactivate.
Install the pip package.
(venv) $ pip install --upgrade "/tmp/tensorflow_federated/tensorflow_federated-"*".whl"
Test Tensorflow Federated.
(venv) $ python -c "import tensorflow_federated as tff; print(tff.federated_computation(lambda: 'Hello World')())"
Reference: https://www.tensorflow.org/federated/install

Installing scrapy on ubuntu 14.04 fails with error in cryptography setup command Invalid environment marker

I tried installing scrapy on another server.
When I run pip install scrapy:
error in cryptography setup command: Invalid environment marker: python_version < '3'
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: python_version < '3'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log
any ideas please help
Python 2.7.6
I did
sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev
and
sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev
I did an sudo apt-get update before that too
The same happens on debian 8. You can pin the cryptography library on version 2.0.3, then retrying.
pip install cryptography==2.0.3
I just encountered this same issue and solved it via:
pip install --upgrade setuptools pip
Apparently the default version of setuptools and pip on 14.04 is insufficient for the cryptography package.

How to install lxml for PyPy?

I've created a virtualenv for PyPy with:
virtualenv test -p `which pypy`
source test/bin/activate
I installed the following dependencies:
sudo apt-get install python-dev libxml2 libxml2-dev libxslt-dev
And then I run:
pip install --upgrade pypy
As a result I get a lot of errors looking like this:
src/lxml/lxml.etree.c:234038:22: error: `PyThreadState` {aka struct _ts}` has no member named `use_tracing`
How do I properly install lxml for PyPy 2.6.0?
I used the following fork of lxml for PyPy instead:
https://github.com/aglyzov/lxml/tree/cffi
It can be installed with:
pip install -e git+git://github.com/aglyzov/lxml.git#cffi#egg=lxml-cffi