How can I integrate Arcpy into Pycharm, I tried by importing the module but it does not show, I do understand that the module only works on 2.x python.
arcpy isn't available on PyPi (Python Package Index) and thus can't be installed through pip.
To use arcpy you need to install ArcMap, ArcGIS Pro, or ArcGIS Server. Any of these programs will create a Python installation with the arcpy package included. To access this from PyCharm, just set the project interpreter in PyCharm to the python.exe installed by ArcGIS.
For example: C:\Python27\ArcGIS10.6\python.exe
Thank you i actually solved by changing the enviroment to python 2.7 and going into Arcgis and assigning the python interpreter to pycharm, thank you so much.
Related
I just installed the R package 'reticulate' and I found it especially useful. But with one con that I need to re-install python module (i.e. pandas) I have already installed.
The python engine is miniconda and the evnv is by default.
How can I specify the python interpreter so that I dont need to re-install all the installed module?
(After some search, I guess it has sth to do with 'virtualenv-tools ' in reticulate?)
By the way, I used to execute python with pycharm and the interpreter is system interpreter located in c://python//python.exe
Any idea?
Have you looked at this page, you have to specify which Python engine you want, in this case miniconda, but just have to tell Rmarkdown where that is located on your computer using the use_python function.
```{r setup, include=FALSE}
library(reticulate)
use_python('/location/to/engine')
```
I am attempting to install IronPython. I downloaded the stable 2.7.5 installer from here:
http://ironpython.net/download/
I ran the installer and all is well. It is not located at:
C:\Program Files (x86)\IronPython 2.7
I have a previous installation of Python 2.7 from my ArcGIS installation, which packages and installs python along with it. My installation location for python is:
C:\Python27\ArcGIS10.2
So, when I test and:
import clr
I receive and error:
ImportError: No module named clr
My Environment Variable Path names are all correct.
I'm just wondering if python IDLE knows where to grab IronPython, or did I install wrong?
The name of the IronPython intepreter is ipy.exe. If you not starting this, you are not using IronPython. So you should see the application name in the window title and when starting the shell. When you use it in an IDE, you should tell the IDE that you are using IronPython, if it support it. Just setting some environment variables will not help. If you are targeting the correct directory and ipy.exe will be used, everything should work just fine.
I have installed iPython using pip in OS X 10.10, and it gave me the "ipython" and "ipython2" commands, which run great, but which use OS X's default python version 2.7.9. I downloaded and installed the latest release of Python3.4 and can load it with the command "python3," but cannot find a way to get iPython to use this version of python. The iPython Web site states the package can be used with python versions 3.3 and above, but I cannot find any instruction on how to change the default python version used.
So far I have found that the jupyter package for iPython has a kernel specification in /usr/local/share/jupyter/kernels/, which is just a folder called "python2" containing a json file that points to the system's python 2.7.6, but altering this to point to the new python3.4 installation does not work. My guess is this configuration is for the ipython notebook.
I've also tried the approach here: ipython reads wrong python version
In doing so I've duplicated the ipython2 command in /user/local/bin/ and edited it to use the python3 interpreter located at /Library/Frameworks/Python.framework/Versions/3.4/bin/python3, however, this gives me an error "ImportError: No module named 'IPython'," which suggests the python3 installation does not have ipython installed.
To tackle this, I've tried uninstalling ipython and reinstalling it using pip, but it just targets the system's Python 2.7 installation and does nothing for python3.
Does anyone know how to configure iPython to use a different python version, or even install a separate ipython installation for python3? Ultimately it would be nice to quickly switch back and forth depending on my needs.
I just found the answer. In essence, this stems from not understanding the python installation layout and how resources are separated between installed interpreters. It appears each python version will have its own repository of tools, and the current "pip" command I had installed on the system was mapped for use with python 2.7, so all libraries, tools, and other details it managed where available only to python 2.7. This included iPython.
I thought that installing python3 would make all these libraries available to the new interpreter by default, but it appears the system keeps them all separate (which makes sense). The main issue here was continuing to use "pip" which targeted the old installation, instead of the new "pip3" command included with python3. By using pip3 to reinstall iPython, I was able to get iPython3 installed properly.
Unfortunately this setup means needing to re-download other libraries, but that's not too difficult.
It might seem like a trivial issue in hindsight, but this had me completely stuck. I hope this helps someone else in this situation.
I am fairly new to Python and trying to install the Pillow package on Windows 7. I downloaded and ran the MS Windows installer Pillow-2.2.1.win-amd64-py3.3.exe from here. It appeared to install fine. If I run the simple line of code:
from PIL import Image
directly from the Python interpreter, it runs fine. A help() on PIL gives me the package contents.
But when I try to run the same line of code from within a script, I get an ImportError: No module named PIL. What am I missing?
(Note that I've been able to import sys and import MySQLdb from within scripts just fine.)
Resolved: sure, enough, I'm running Python 2.7 when I run scripts. (I think I vaguely recall having to install an older version so I could interface with MySQL.) Thank you all for pointing out that I should check the version being used.
For third-party modules for Windows, my go-to resource is Christoph Gohlke's Python Extension Packages for Windows. You can find the latest version of Pillow here. Make sure you're working with the python.org version of Python.
As far as your specific error, it's hard to tell exactly without a traceback, but make sure your script is calling the correct version of Python. If you have also installed Python 2.7, for example, your script may be calling that instead of 3.3.
In such cases I'm simply printing the sys.path at the beginning of the script in trouble and comparing it with the one from the working python interpreter. In most cases I was running the script with a different python interpreter.
In my case , I was referring to wrong pip folder.
Changed virtual environment in pycharm to point to right pip folder to solve this issue
import sys
print ( sys.path )
I recently downloaded and installed feedparser with python,
I tried to run it but Netbeans shouts on import:
ImportError: No module named feedparser
restarted the Netbeans, still no go.
Netbeans by default uses Jython,
if you go to Tools>Python Platforms and see that Jython is the default.
Switch it to Python and so the installed libraries would work.
If you already have a project, you should right click on it, choose Python and on the platform choose Python instead of Jython.
You might need to set the PYTHONPATH environment variable to include the install path of feedparser. Just a guess, but this has fixed this issue in the past for me.