Install Package in Python - python

I'm trying to install bayespy on enthought canopy and have read through all the documentation and cannot figure it out. I import pip and then run the following code (I have tried many variations on this too) :
pip install <bayespy>
It keeps coming back with an error message. Do I need to specify the file path to bayespy possibly?
Thanks in advance,
Max
Edit :
pip install <bayespy>
File "<ipython-input-2-bb1febf67aaf>", line 1
pip install <bayespy>
^
SyntaxError: invalid syntax

The most basic usage of "pip" is as a command-line tool. Try this from the command prompt (NOT within a Python shell):
pip install bayespy
or perhaps
sudo pip install bayespy

First: BayesPy requires Python 3.
Try This:
yourMachine> sudo pip3 install bayespy
Not this at python prompt: >>> sudo pip3 install bayespy

Related

pip install pandas not working even though it seems I have got pip

I have installed Python on Windows though it is not in my PATH variable. I want to use pandas
When I do import pandas, I get error that pandas modules can't be found
When I do pip install pandas, I get error that pip is not a command
When I do python -m pip --version, I can see pip
Why am I not able to use pip?
I had to first update pip (optional I think) - python -m pip install -U pipand then use it like thispython -m pip install pandas`

pip install in python 3.6.5

I'm trying to install some libraries on python, and I open cmd and type-m pip install <lib_name> but it says there's syntax error. When I skip the "<" it says pip is not a recognized command. Any help? I'm using Python 3.6.5.
enter image description here
this is the output for almost every command I'm trying...
first of all we need to know if you are good to go with pip.
Try posting the output of
pip --version
If pip doesn't seem to be installed, you should install it via
python -m ensurepip --default-pip
Once pip is installed you can install packages using the command
pip install whatever
Here's a complete starter pack tutorial for using pip :)
https://packaging.python.org/tutorials/installing-packages/
you can enter either cmd into the terminal:
python -m pip install <package-name>
or
pip install <package-name>
The first will always install into your global environment and the second could depend on whether you're in a virtualenv (if none of this makes sense to you, don't worry about it).
First install python!
According to your screenshot, it is not installed... (or not available, in that case check your PATH in system properties).

Install requests module show SyntaxError: invalid syntax

Please view the image to help me find out what wrong with my code.
You have to run it in cmd.exe, not in Python Shell.
C:\> python -m pip install requests
or
C:\> pip install requests
if its on windows
Open command prompt
Go to Python install directory
python -m pip install --upgrade pip
python -m pip install requests

pip 2 & 3 Syntax change

I use an arch-linux system and just installed pip via yaourt.
yaurt -S pip
Then I tried to install something via pip for python 3. But I get an error like this:
pip install requests
install: missing destination file operand after ‘requests’
Try 'install --help' for more information.
where
pip2 install requests
will just work.
What is the "missing destination file operand"? What am I supposed to pass?
The comments were right to assume that it has to work usually. There must be something wrong with the packed pip package for yaourt. I reinstalled python-pip via pacman and everything just works as intended.
I see this is an old question, but for anyone who got here from a google search like me, the "pip" package in the AUR is not the python package manager! Install the package python-pip instead.
I got this after a typo:
sudo -h pip3.6 install bpython
install: missing destination file operand after 'bpython'
Try 'install --help' for more information.
Fixing the parameter did the trick:
sudo -H pip3.6 install bpython

Unable to install CherryPy

I know this is a very dumb question, but I can't install CherryPy. In the documentation is written:
To install, change to the directory where setup.py is located and type (python-2.3 or later needed):
python setup.py install
Which is what I do, I type this in Python Shell and it gives me error Invalid syntax, but I don't think I have any syntax errors.
You won't install programs in the Python shell. Navigate to where you downloaded the source and run python setup.py install.
Alternatively, you can use pip:
pip install cherrypy
The best installation for Cherrypy, Mako, Python with terminal in Ubuntu is:
sudo apt-get install subversion python-mako python-simplejson python-cherrypy3 graphviz
And after sudo apt-get update and after sudo apt-get upgrade
"I type this in Python Shell"...
Don't type that in the Python shell.
>>> python setup.py install
File "<stdin>", line 1
python setup.py install
^
SyntaxError: invalid syntax
Type it at the commandline.
$ python setup.py install
Or if you're on Windows:
C:\>python setup.py install
I have found out the steps to install via command prompt, please fer to the attachment below. For me "python setup.py install" does not work but it works find for "setup.py install" after I pointed it properly to the directory>
Hope my experiment helps:
Step1
Step2
If you are installing on Mac and say you are using python 3, you would want to use:
sudo python3.3 setup.py build
Then after build is finished.
sudo python3.3 setup.py install

Categories

Resources