I'm trying to install a package 'backtesting' in my Anaconda prompt by typing 'pip install backtesting' but getting EnvironmentError......
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\users\james\appdata\local\continuum\anaconda3\lib\site-packages\~il\_imaging.cp36-win_amd64.pyd'
Consider using the --user option or check the permissions.
How do I 'Consider using the --user option or check the permissions.'? Many thanks in advance
please try using below:
pip install backtesting --user
I tried it and successfully installed the package.
The above answer is the correct '--user' usage.
I find when I cannot install with conda or pip keywords, I simply add the module to the environment variables.
You can do this by accessing your search field on your taskbar and type 'Environment variable' (minus the single quotes) which will produce a window allowing you the option to edit environment vars.
Or you can go directly to 'System Properties' and select the 'Advanced' tab. On the bottom right is a button for environment variables. Clicking on environment variables
you are taken to a new window.
Selecting 'New' from the 'System Variables' field, you want to add the full path of your project solution and once saved your program can 'see' the module. The clincher is you must restart your computer after adding the variable, once the computer is back up the edited 'Environment Variable' becomes effective. You will be able to use the import statement like you always do at the start of program without the error.
Related
After installing PyCGNS python package from Anaconda distribution, I am not able to open CGNS files as recommended in the following pages using the command line CGNS.NAV or cg_look:
Browsing your CGNS tree with NAV
Here is the error message I am receiving whether I am running the command line in Git Bash, Powershels, or CMD:
CGNS.NAV: FATAL error, cannot import qtpy.QtCore...
Hints:
pyqt5 is already installed
print(sys.path)
'C:\\ProgramData\\Anaconda3\\Scripts', 'C:\\ProgramData\\Anaconda3\\python38.zi
p', 'C:\\ProgramData\\Anaconda3\\DLLs', 'C:\\ProgramData\\Anaconda3\\lib', 'C:\\
ProgramData\\Anaconda3', '', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages', '
C:\\ProgramData\\Anaconda3\\lib\\site-packages\\vboxapi-1.0-py3.8.egg', 'C:\\Pro
gramData\\Anaconda3\\lib\\site-packages\\win32', 'C:\\ProgramData\\Anaconda3\\li
b\\site-packages\\win32\\lib', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\
Pythonwin', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\IPython\\extensions
', 'C:\\Users\\user_name\\.ipython']
You need to install PyQT.
Open the cmd.exe prompt from the anaconda navigator (in the home menu).
Execute this command:
conda install pyqt5
If you already had install it, maybe it's not in your enviroment.
Please post the output from:
print(sys.path)
Find out where PyQt5 is installed and ad it to your path-enviroment. You will find plenty of howto's in the internet. Here is one of them (Source: https://www.educative.io/edpresso/how-to-add-python-to-path-variable-in-windows):
Right-clicking This PC and going to Properties.
Clicking on the Advanced system settings in the menu on the left.
Clicking on the Environment Variables button on the bottom right.
In the System variables section, selecting the Path variable and clicking on Edit. The next screen will show all the directories that are currently a part of the PATH variable.
Clicking on New and entering Python’s install directory.
I tried installing PIL with pip it gives me this error:
C:\Users\AppData\Local\pip>pip install
http://effbot.org/downloads/Imaging-1.1.6.tar.gz 'pip' is not
recognized as an internal or external command, operable program or
batch file.
I've had these issues as well. There could be many reasons, one of these should fix:
1. PIP not added to system PATH
This being the most common issue and is easily missed by new users. check this for answers.
2. When you're using a python IDE such as Anaconda but haven't actually installed python directly
You can open the Anaconda Prompt (in the Anaconda file group in your start menu) and then use pip.
3. You have installed python for only the installing user (mostly admin)
Your system has multiple accounts and if you have installed using admin or similar account and missed 'install for all users', you'll need to open the CMD using 'Right click > Run as Administrator' option with a valid admin username/pwd.
I have python 3.7 with 32bit and after I did pip install pygame, I'm still getting
ModuleNotFoundError: No module named 'pygame'
when running my code. I'm using pycharm.
I would just like to add to what the first answer is saying:
If you are using pycharm, it still won't work until you go to file >> settings >> >> [your project name] >> python interpreter. You will see a list of packages there. If pygame is on it, then good, else, you must double click on the field where the packages are. It leads you to a little pop up box where you can type in things. If you type in pygame, you should be able to install the package.
To be sure that you installed the python3 proper module u need to use
pip3 install pygame
I ran into the same error a few days ago! Thankfully, I found the answer.
You see, the problem is that pygame comes in a .whl (wheel) file/package. So, as a result, you have to pip install it.
Pip installing is a very tricky process, so please be careful. The steps are:-
Step1. Go to C:/Python (whatever version you are using)/Scripts. Scroll down. If you see a file named pip.exe, then that means that you are in the right folder. Copy the path.
Step2. In your computer, search for Environment Variables. You should see an option labeled 'Edit the System Environment Variables'. Click on it.
Step3. There, you should see a dialogue box appear. Click 'Environment Variables'. Click on 'Path'. Then, click 'New'. Paste the path that you copied earlier.
Step4. Click 'Ok'.
Step5. Shift + Right Click wherever your pygame is installed. Select 'Open Command Window Here' from the dropdown menu. Type in 'pip install py' then click tab and the full file name should fill in. Then, press Enter, and you're ready to go! Now you shouldn't get the error again!!!
Probably you have several instances of Pythion on your computer. You may install pygame in one instance, but IDE uses another.
I'm new to python, I'm using Windows 10 and have python36 and I basically have to use nltk for my project and i basically have two questions.
1 I heard pip is automatically downloaded for versions 3+ but when I type pip install nltk in command prompt im getting the following error even though i added its path "C:\Users\dheeraj\AppData\Local\Programs\Python\Python36\Scripts\pip36" in advanced settings and ya in above path i tried pip36 and pip in both cases result is same.
'pip' is not recognized as an internal or external command,"
2 In www.nltk.org I found nltk for mac, unix and windows32 but not for windows64 ,does that mean it doesnt support for 64bit or is there any way for me to install nltk.
I had the same problem as you, but I accidentally found pip.exe in my python directory, so I navigated to said directory with CMD and ran the command pip install -U nltk and it worked.
Run the Python interpreter and type the commands:
import nltk>>>
nltk.download()>>>
A new window should open, showing the NLTK Downloader. Click on the File menu and select Change Download Directory. For central installation, set this to C:\nltk_data (Windows), /usr/local/share/nltk_data(Mac), or /usr/share/nltk_data (Unix). Next, select the packages or collections you want to download.
If you did not install the data to one of the above central locations, you will need to set the NLTK_DATA environment variable to specify the location of the data. (On a Windows machine, right click on “My Computer” then select Properties > Advanced > Environment Variables > User Variables > New...)
Test that the data has been installed as follows. (This assumes you downloaded the Brown Corpus):
from nltk.corpus import brown>>>
brown.words()>>>
['The', 'Fulton', 'County', 'Grand', 'Jury', 'said', ...]
Installing via a proxy web server
If your web connection uses a proxy server, you should specify the proxy address as follows. In the case of an authenticating proxy, specify a username and password. If the proxy is set to None then this function will attempt to detect the system proxy.
nltk.set_proxy('http://proxy.example.com:3128', ('USERNAME', 'PASSWORD'))>>>
>>> nltk.download()
Command line installation
The downloader will search for an existing nltk_data directory to install NLTK data. If one does not exist it will attempt to create one in a central location (when using an administrator account) or otherwise in the user’s filespace. If necessary, run the download command from an administrator account, or using sudo. The recommended system location is C:\nltk_data (Windows); /usr/local/share/nltk_data (Mac); and/usr/share/nltk_data `(Unix). You can use the -d flag to specify a different location (but if you do this, be sure to set the NLTK_DATA environment variable accordingly).
Run the command python -m nltk.downloader all. To ensure central installation, run the command sudo python -m nltk.downloader -d /usr/local/share/nltk_data all.
Windows: Use the “Run...” option on the Start menu. Windows Vista users need to first turn on this option, using Start -> Properties -> Customize to check the box to activate the “Run...” option.
Following are the steps I followed to resolve this issue:
Click on Python 3.6 Module Docs (32 bit). This will open in your default browser.
Click on pip(Package), displayed at the end of the page.
You will be redirected to a page displaying details of the package. Find the exact path from there. It will be something like c:\users\grove\appdata\local\programs\python\python36-32\lib\site-packages\pip
Run this on cmd prompt.
Once you're in pip folder type pip install -U nltk
Go back to Python Shell and type import nltk
Directly Search for pip folder and navigate throught that path example:
C:\Users\PAVAN\Environments\my_env\Lib\site-packages\pip>
Run cmd
and then run the command
pip install -U nltk
I will recommend you to use the Anaconda on Windows. Anaconda has nltk version for Python 64-bit. Now I'm using Python 3.6.4 64-bit and nltk.
Under python shell run:
import nltk
nltk.download()
then the downloader will be open in new window and you can download what you want.
First install the module
like pip install -U nltk
and the use the import statment in the command prompt or IDLE
import nltk
I recently installed Anaconda onto my laptop and I am trying to install a conda environment called pydecal that uses python 3.5. I have tried this in CMD as well as in Anaconda Prompt. I did not enter Python when Below is my code:
conda create --name pydecal python=3.5
I am getting a "Failed to create process." message every time I try to run the command. Anaconda installed fine in 64-bit. I am on a clean install of Windows 10. I have no other instances of Python on my computer whatsoever. I have tried running CMD and Anaconda Prompt as an administrator. I have restarted my laptop several times. Regardless, I run into the same problem. Any ideas on what is going wrong?
Did you install it on the primary drive (C:)?
My conda did not work either. I have just uninstalled Anaconda3 which was formerly installed in a secondary drive (E: rather than C:).
After installing Anaconda3 on the primary drive (C:), conda seems to work fine.
I solved it by making this way:
1: Install Anaconda in a directory structure not containing spaces.
2: Modify system environments to not include %PATH% in the user section.
I found that 'echo %PATH%' in a prompt resulted in the system defined paths, were shown twice.
3: Moved all paths containing %SYSTEMROOT% to the top search order. This was to assure the need to search obscure named paths was not searched by the 'activate' command.
Let me know if this solves your problem.
Br Michael
I solved it this way:
Opening the "Anaconda Prompt" Console Link that Anaconda creates in the start menu. As conda appeared to work fine there I copied the predefined envinronment variables for that prompt :
If you check the link, it executes this:
%windir%\System32\cmd.exe "/K" C:\tools\Anaconda3\Scripts\activate.bat C:\tools\Anaconda3
and that file refers to C:\tools\Anaconda3\condabin\conda.bat
So finally the path is specified there as :
C:\tools\Anaconda3;C:\tools\Anaconda3\Library\mingw-w64\bin;C:\tools\Anaconda3\Library\usr\bin;C:\tools\Anaconda3\Library\bin;C:\tools\Anaconda3\Scripts;C:\tools\Anaconda3\bin;C:\tools\Anaconda3\condabin;
I added that to the Windows System Environment variables and it now works properly on git bash, and other shells.
pip install pathlib
that is what i did now everything works