i don't have a clue how to install packages but when i copy and paste what websites show, it always comes up with a syntax error
pip3 install cryptography
SyntaxError: invalid syntax
i don't have a clue how to install packages but when i copy and paste what websites show, it always comes up with a syntax error
pip3 install cryptography
SyntaxError: invalid syntax
First of all, you need to make sure python is added to your path.
Here is a tutorial. Where basically, you need to find where your python is installed, copy the path, and paste to the advanced environment settings as shown in the tutorial.
Once you have done, you can run your command prompt, run python
, see if things work.
If it works, you can now run pip install cryptography
:)
For Mac users:
Try which python
and which pip
at your terminal
Are you running it in the python interpreter? Or the command line? (also called the terminal). You should be running it in the command line.
Python interpreter is for running python programs, ".py" files. Once you install "cryptography" module in the command line using the command "pip3 install cryptography" use this module in the python interpreter by importing it using the line:
import cryptography
On Windows, you need to make sure your PATH is configured correctly. Pip is a python module usually stored in a subdirectory of Python itself.
Did you set up the PYTHONPATH environment variable correctly? In your environment variables (Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables) System Variables section, you should have PYTHONPATH pointing to the Python install. (On my machine, this is "C:\Users[your user profile]\AppData\Local\Programs\Python").
Then, in the Command Prompt (which you can access by pressing win+r and then typing cmd
in the resulting window), you call pip as a module of python:
python -m pip install cryptography
A simple way to properly install python and avoiding having to manage path is:
~\anaconda3
. Anaconda will also update your .bashrc
or .bash_profile
setting the proper path for python. The Pyhton version installed will be python 3 (at current date).
conda install pip
. Now you can use pip
without encountering any error. As explained in the answer here: pip3 and pip would make a difference only when you are not using any environment managers like virualenv (or) conda. Now as you are creating a conda environment which has python==3.x, pip would be equivalent to pip3.