I am trying to set and install some packages with python. I have already installed python3 along with Anaconda.
My first question is that when I type:
$ python3
Anaconda says: "$" is not an internal or external command. Should I be using a different command or how can I fix this?
My second question is this: I am trying to install the packages from these four sites based on a book I got:
NumPy: http://docs.scipy.org/doc/numpy-1.10.1/user/install.html
SciPy: http://www.scipy.org/install.html
scikit-learn: http://scikit-learn.org/stable/install.html
matplotlib: http://matplotlib.org/1.4.2/users/installing.html
This note was in there as well: "If you are on Windows, you should have installed a SciPy-stack compatible version of Python 3".
When I go to copy the line for installing the packages on windows and pasting it into my terminal, it gives the error: "The system can not find the file specified"
How can I fix this?
Don't type the $, just python3.
The packages you mention are already included in Anaconda python distribution.
$ is usually used to indicate the start of a line that should be executed in a terminal window. So, therefore, remove the $ and write everything that comes afterwards.
If you installed Anaconda, then you should have the conda command available to you. Besides scikit-learn, the packages should already be installed with your Anaconda distribution. What you could do is $ conda install scikit-learn and this should install scikit-learn for you.
I recommend you to look at the documentation of Anaconda at the Anaconda website (https://docs.anaconda.com/anaconda/) to learn more on how Anaconda, packages and Python works.
Just as emmv said, a few other things in my mind:
You installed Python with Anaconda. I assume you did not add Python to PATH. You should check Anaconda website for any further installments, downloads etc.
Anaconda uses a simple "conda" command, after all. Really, just look at Anaconda's website if you are confused.
Related
I am doing this project where i need to install a package called Twint.
I want to install this package and use it's commands in my VS Code.
What happends when i for example type this in my Windows CMD?
pip3 install --user --upgrade git+https://github.com/twintproject/twint.git#origin/master#egg=twint
Because i can't type this in my VS code terminal, where i usually install packages with pip.
It will return an error that says ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?''
Now if i run this in my Windows Command it seems that i can't directly import the package in VS code?
Can anyone help me out with this confusion, where does the files get stored and how do i create good habbits around installing packages?
Hope someone understands what im struggeling with here.
Best
It is often the case that computers have more than one version of python installed and that editors like VS code use a different version than pip uses on the command line. pip installs packages where the version of python it is linked to expects them to be, but VScode doesn't know to look there.
It sounds like you have git installed where pip installs things, so you can upgrade from the command line without issue, but there's no installation of git where VScode is looking, so there's nothing to upgrade.
You either need to find where pip installs things and add it to the $PATH VScode uses, or try running a variation of python -m pip install --user git (specifying a specific url, or other things, as needed) from within VScode, which will ensure the package gets installed in a place that VScode looks for packages.
Download and Install git in your windows from here:
https://git-scm.com/download/win
Then add its installation bin path to your windows's environment path. Then you will find the git command at the command prompt globally.
This may solve you problem.
Right now I'm trying to install python (3.10) and all further installations on my new pc (windows 10) and so far everything is set up:
Python installed
Windows paths for "Python" & "Python\Scrips"
I am able to call the python and pip version and also install some packages. But after installing virtualenv and creating one the - at the moment - unfixable error appears: I am unable to install packages into the pip-path of the virtualenviroment itself. Whenever I'm trying to run any pip-command I'm getting the following error:
Unable to create process using 'C:\Users\ExampleUser\AppData\Local\Programs\Python\Python310\python.exe "C:\folder\env\Scripts\pip.exe" '
As you can see, it's always refering to the original python-path, but on the other hand it's refering to the pip-path of the virtualenv!? Don't know if it's helpful, but when typing in where python and where pip the paths inside the venv are the first one listed. I've also watched out for no blank spaces in my path...
Unfortunately no explanation out there could help me until now and I never faced this problem on my old machine - mostly the same, except some older version of python, pip and virtualenv.
Does anyone else has an idea what I am missing?
downloading Python 3 at the official website and installing it via express installation
Copy & Paste the standalone python into the /python folder and overwriting the python version
running python -m pip install --upgrade pip in cmd
Now pip and python 3 are installed in their latest version.
It's work for me
Could you use venv to create your virtual environment, instead of virtualenv (given that venv is the recommended way to create virtual environments for Python 3.3, and newer)?
If using venv is an option, this procedure may give you some idea on how to do it.
I have not done any Python development on Windows, but I think the basics would be:
python3 -m venv your-env-directory
your-env-directory\Scripts\activate.bat
If using venv is not an option, maybe you can try specifying the -v flag when running your virtualenv command to increase verbosity so you can further troubleshoot what's going on.
try upgrade pip version python -m pip install --upgrade pip
[ Sorry if this answer turns out to be more of a comment than an answer. I only have 21 reputation, so I cannot comment ]
When trying to install pip packages and run python files, is the CWD (Current Working Directory) C:\folder\env\Scripts? If so, try chaning your CWD to C:\folder. I had a similar problem and doing this fixed it.
You may need to look into a cygwin environment, and look into a chroot or jail environment to run the application without conflict.
Have you tried to use virtualenv-wrapper-win module.
It helps me a lot to manage virtual envs
Life is much easier using Anaconda 3 (it's definitely bloated compared to normal Python though), or use the minimal Miniconda (barebone install, basically just Python + a package manager). You can download it here: https://docs.conda.io/en/latest/miniconda.html#windows-installers
Then you can make a new virtual environment super easy:
conda create -n myenv pip
conda activate
If you have multiple environments you do: conda activate [environment_name]
Now you're in your new environment with pip installed. And you get drop down menus in the Windows menu to get to your new environment too, so there isn't any searching required. They just appear. Now if you want to link Jupyter Notebook or Spyder to the installation, it takes more steps since you need more packages. I used this guide which basically activates Jupyter first, then Spyder IDE. https://medium.com/#apremgeorge/using-conda-python-environments-with-spyder-ide-and-jupyter-notebooks-in-windows-4e0a905aaac5
Since you created the environment with pip added you can pip install whatever packages you need. I had to do this recently with OpenBLAS backed NumPy and SciPy (the defaults from pip, not from conda). Now Miniconda is the closest thing to basic Python installation, and comes with some nice tools to make your life easier. Hopefully this is helpful.
I tried to install GraphLab, but the result became like this:
AttributeError: module 'graphlab' has no attribute 'connect'
My python version is 3.6.1. And I also tried the code:
python -m pip install connect
But it didn't work.
Does anyone know how to solve this problems? Thanks!
This happens when Version in python on system is different from Anaconda. Anaconda Python is mixing in imports from the regular Python on the system. Make sure "which python" points to the right Python (whereever you installed Anaconda Python. And similarly "which pip" Otherwise you will want to run python (or pip) from [where ever you installed Anaconda]/bin/python. You can try the Dato Launcher which tries to set it all up for you.
Also, if you are not using Anaconda, on Graphlab support of installation, they recommended only two option for installation, one on Anaconda and the other on Virtualenv. I personally recommend you to use Anaconda for Graphlab as most of the development support and learning is totally based on Anaconda usage. You may follow this link to install Graphlab and Anaconda Here. I hope this helps.
Note: In installation of Anaconda, Python Version can be different like Python 2.7, but after installation of Anaconda, you can update to latest version of your choice.
I recently installed Anaconda on Arch Linux from the Arch repositories. By default, it was set to Python3, whereas I would like to use Python2.7. I followed the Anaconda documentation to create a new Python2 environment. Upon running my Python script which uses Numpy, I got the error No module named NumPy. I found this rather strange, as one of the major points of using Anaconda is easy installation of the NumPy/SciPy stack...
Nevertheless, I ran conda install numpy and it installed. Now, I still cannot import numpy, but when I run conda install numpy it says it is already installed. What gives?
Output of which conda: /opt/anaconda/envs/python2/bin/conda
Output of which python: /opt/anaconda/envs/python2/bin/python
The anaconda package in the AUR is broken. If anyone encounters this, simply install anaconda from their website. The AUR attempts to do a system-wide install, which gets rather screwy with the path.
I've been using Canopy and IPython notebook especially, most of the time. I installed Python3.4 from Python.org at the very beginning. Since then every time I run my IPython notebook and if there is any packages that I am missing, I download them by using the package manager in Canopy. However, recently I started that tango with Django tutorial project and used a lot of command lines. I installed Python2.7 later, and the related packages by using pip ever since. My question is: what's the relation of Canopy package manager and pip? Because I am not afraid I might have downloaded the same packages and created unnecessary duplicates more than once by using them separately and simultaneously...Thanks
Type:
which pip
It will tell you if pip is pointing to your canopy python directory, or to your system python directory. I believe that pip will use whatever your system's default python is. You can figure this out by typing:
which python
Generally, when I put canopy on a computer, I make canopy the default python (it will prompt you the first time it starts up, and you can set it in the options later). After I do this, pip will install packages to the canopy python directory. This layout usually works best for us, because you can still use:
python setup.py install
To install packages to canopy.