Does anybody have documentation on how to set up the Canopy Python environment as an interpreter within Visual Studio? I am new to VS and Canopy so I apologize if this seems trivial. I have read the following sites but still struggling to get Canopy integrated as the interpreter. Currently Python 64bit 2.7 is the only interpreter that shows up.
Install
https://pytools.codeplex.com/wikipage?title=PTVS%20Installation
Environments
http://pytools.codeplex.com/wikipage?title=Python%20Environments
Python Tools for Visual Studio (PTVS) will typically automatically detect Canopy and show it as "Python 2.7 64-bit". You can check to see if it is detecting Canopy by selecting 'Environment Options' in PTVS. The path in 'Path' by default will be something like ...\AppData\User\Enthought\Canopy\User... If this is what it is finding, you should be set.
If the Python interpreter PTVS is finding is not Canopy, then it sounds like you have another version of Python installed. This is ok and there are two options.
If you want it to find Canopy automatically, you need to be running Canopy 1.1 or later and make it your default Python environment. To update Canopy if needed, go to Help -> Software Updates. Then to make it your default Python environment, Edit -> Preferences and click the button to make it your default. This has the effect of changing some Python-standard registry keys.
If you don't want Canopy to mess with your environment, that's completely fine, too. You can get the same effect by clicking 'Add environment' in the PTVS environment options dialog. The settings for a default Canopy install are:
Path: C:\Users\\AppData\Local\Enthought\Canopy\User\python.exe
Windows path: C:\Users\\AppData\Local\Enthought\Canopy\User\pythonw.exe
Lib: C:\Program Files\Enthought\Canopy\App\appdata\canopy-1.1.0.1371.win-x86_64\Lib
Note that the first two point to the 'User' environment whereas the last points into the core install.
The upcoming Canopy 1.2 release in a couple of weeks will include more complete integration with PTVS and Visual Studio that will automate this and remove the need for Canopy to be the default Python environment.
Related
From Visual Studio Code, I can only see the available environments:
Python 2.7
Conda x.x
I have the following self-installed Python versions:
C:\Python\Python2.7\
C:\Python\Python3.7\
Why is Python3.7 not appearing?
Verify that all binaries are on the same admin elevation level
C:\Python\Python2.7\ <--- rarely used, NOT elevated as admin
C:\Python\Python3.7\ <--- frequently used, elevated as admin
VSCode itself was NOT elevated, and therefore only allowed non-elevated binaries to be selected.
After elevating the VSCode binary to admin, all Python environments were available.
The documentation on environments explains how the extension finds installations of Python as well has how to specify the location manually.
I am currently using Pycharm. What I like about PyCharm are the following:
Simplicity of creating virtualenvs
Intellisense
GUI package installer
Console (automatically activates the venv)
However, I also lacked the following
intellisense for javascript (I believe they require a paid
license)
I recently tried visual studio but it lacked
GUI package installer
Is there an ide that can give me all the aforementioned features? I need to use this ide for full stack development in Python
Simple problem, made difficult of course , by Microsoft. How do I install sqlite3 or Pmw on my Visual Studio Community version of Python. I normally place the files my self into site packages folder. With Visual studio they talk about packet manager but where is it? Can it really be this hard?
Hopefully you have the Python Tools for Visual Studio plugin installed. If not, go to https://github.com/Microsoft/PTVS to get v2.2. You can also check out a PTVS Getting Started tutorial series on YouTube.
Assuming you have PTVS, right click on your Python Environments in your solution. Add Virtual Environment.
Right click on the env and choose Install Python Package.
Install your Python package.
For SQLite3, you place your .db or .sqlite3 file in your project. If you copied it manually in and you want Visual Studio to "see it" in the Solution Explorer, you may need to right click on the solution name and Add Existing Item...
I also recommend you go to "Tools >> Python >> Python Environments" to bring up a pane where you can explore any Python versions or virtual environments available to this solution. You can see which module are installed, if they're out of date, and search the PyPI directly from there.
Just go to your Python/Scripts folder at the command prompt and "pip install ". You may need an administrator command prompt.
If it's a package with binary components (numpy, etc), you can download and install from here (very useful site): http://www.lfd.uci.edu/~gohlke/pythonlibs/ Just be sure to get the version and 32/64 bit that matches your python.exe.
Within VS2015, Tools - Python Tools - Python Environments. Select an environment from the left side, and you'll see an entry one column to the right 'pip'. Select that. There's now a search box where you can type in the package you want. Then scroll down and select "Install package".
This isn't my first time using Eclipse or installing PyDev but this is the first time it both succeeded and failed.
It succeeded because it installed, it shows up as being installed and installation went on fine without a problem.
It failed because nothing has shown up, there is no Python perspective, no PyDev views in the view list, no new projects under PyDev, no PyDev preferences. It is as if it is not actually installed at all.
The only thing I did differently is extract the latest eclipse to a folder called ~/eclipse and create a short cut to run it there (the latest Eclipse), usually I use apt-get to install eclipse, realise it's an old version (C++11 stuff missing) then upgrade and do this. Somehow PyDev is usually carried forward.
I'm not sure how it can list it as being installed but have this error, I'd appreciate any help you guys can offer.
I bet it's the problem of 3.x version of PyDev. It demands java 7.
2 solutions are possible:
Install java 7. re-run the Eclipse, Pydev should function well now. OR
Install last 2.x version of PyDev.
To do it
1) Remove PyDev : In Eclipse About window click Installation Details
button below. You will see controls for removing plug-ins.
2) Install 2.x version of PyDev:
Eclipse Help->Install New Software.
REMOVE CHECKBOX "Show only the latest version" located at the bottom of the dialog.
Choose Pydev update site from the list and in the appeared list of PyDev versions choose latest in 2.x branch.
The problem is really that sometimes even installing java 7, Eclipse does not get it.
In http://pydev.org/download.html, there's a section called: PyDev does not appear after install!
Try to follow it to see if it fixes your problem (i.e.: making Eclipse find java 7).
Another option would be using PyDev standalone (i.e.: LiClipse). Although it's commercial, it should come with all the requisites builtin (so, no hassles to install) and is updated whenever PyDev itself is updated.
I setup PyDev with this path for the python interpreter
/System/Library/Frameworks/Python.framework/Versions/2.5/Python
since the one under /usr/bin were alias and Eclipse won't select it. I can run my python script now but cannot run the shell as an external tool. The message I get is
variable references empty selection ${resource_loc}
Same if I use {container_loc}
Any thoughts ?
Sunit
I installed the Python.org version as well, this is a must.
I finally got PyDev working in Eclipse by pointing the interpreter to:
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
manually. If you don't do it manually (by using the Autoconfig) it seems to not find the right version.
Common practice seems to be to install an up-to-date Python 2.5 from python.org and use that instead of the system installation. I saw that recommended here and there when I got started on Mac OS X.
It installs under /Library (as opposed to /System/Library) so the system Python is intact. Pydev has /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python as its configured Python interpreter and all is well.
Can't state for sure that your trouble is due only to using the system's Python installation; in any case this way I have no trouble. Also, this way when you fiddle with your development environment (install things in site-packages, upgrade Python), anything that uses the system Python is sure to be unaffected.
I know this is a ancient post... but, in case of some newbee like me to get the better answer.
I just using "Eclipse Marketplace" from the "Help" menu and search for keyword "python" or "PyDev" to get PyDev, and get it successfully installed.
AND, you should add PyDev to the top-right dock.
For the instance, my eclipse on my laptop's OSX is (Version: Indigo Service Release 2 Build id: 20120216-1857).
Have fun, folks! :)
I believe ${resource_loc} or ${container_loc} (without any argument) are based on the current selection in your workbench when you are launching your script.
So are you selecting the right resource when selecting that script through the "external tool" runner ?
At least, click on the project name before you run one of the external programs.
Note: it works with a selection in the Navigator or Package Explorers views (the latest might not be available in PyDev environment though)