Error While Opening Django Shell - Python Interactive Window in Visual Studio - python

I just wanna mention that i'm just learning python & django so i'm a newbie and i need help.
Sorry if my question is dumb.
Here is my problem -
I was following the lesson - https://mva.microsoft.com/en-US/training-courses/developing-websites-using-python-and-django-11415?l=uw7LHeEJB_5304300477
And i tried opening the python interactive window by Right Clicking On DatabaseFun (My project name from solution explorer) > Python > Open Django Shell
And the Django Management Console -DatabaseFun windows opens up with error :
" Python interactive window. Type $help for a list of commands.
An internal error has occurred in the Interactive window. Please restart Visual Studio. "
And the Django Management Console -DatabaseFun window seems to be disconnected
Additional Details -
I've installed Python 3.5 - 32bit
Visual Studio 2015
Screenshots -
View post on imgur.com
Please Help , I'm struck for almost 10hours.

Sorry if i don't really answer your question but i suggest that you change the tools you are using.
IMO Visual Studio is far from good to code in python.
If you're a beginner and really want to use an IDE you could try PyCharm otherwise, a simple text-editor (SublimeText, Vim, Emacs) and a command-line are all you need.
You'll learn more, and will get rid of bug caused by your IDE (like the one you're having now).

Actually the error seems to be with the PTVS 2.2 as suggested by a github member i updated it to PTVS 2.2.2 which was released few days ago and the error disappeared.
https://github.com/Microsoft/PTVS/releases/tag/v2.2.2
Just wanna post this answer so that it may be useful for someone (haven't seen many answers for Visual Studio errors) .

Related

Aptana server currently unavailable

I am a complete newbie to all of this so please be gentle. I am trying to learn python and have started to follow exercises from Lynda.com. The video I am watching suggests to download Aptana Studio 3.6.1 to use with Python. I have downloaded and installed it however upon opening the Aptana Studio start page keeps coming up with the following error:
Server Currently Unavailable.
I have been trying to find a solution but have had no such luck. I am hoping one of you might be able to help.
Just a reminder I am completely new to this so please explain everystep as simply as possible.
Thank you for any help or advice you can give me.

How to select winpython interpreter for Visual Studio 2017 community edition?

I want to use winpython interpreter for Visual Studio 2017 community edition. I found settings for another IDE here: Using WinPython as Interpreter for PyCharm. Where can I find similar settings for VS 2017 community edition?
(finally my first post after so long following. It's a shame, because it's maybe not the best answer, but it's late here)
You have to add your WinPython as a custom python enviroment.
Following steps:
Open VS an look for Tools > Python > Python Enviroments and then hit "add custom..."
There are several fields to be filled, which are nearly self explained (Path of Interpreter, window-interpreter etc.). I think, if you enter the Interpreter-Path, you can hit the button "auto-fill" on the right side an VS will try to look for the other fields automatically.
That's it. But the more interesting question is "Does Intellisense recognizes the packages in WinPython like scipy?"
Yes. But Intellisense needs a first date with the packages. Otherwise you won't cross the doorstep.
Open Tools > Python > Python Enviroments
Click on your Custom Python environment (WinPython, I still guess) and then click the field, where "configure" is listed an look for the Option "Intellisense". Then VS will look vor all modules. Be patient, at my machine it took some time.
After recognizing all modules (no red ! sign anymore, a blue check), you can hit the new appearing button above "Update Database". This will take less time.
In my case (a few minutes ago) I had to restart VS. When I hit numpy.p either in editor or interactive console, there appears auto-complete with every info you wish to have (in a pythonic, not a general way).
good night!
Sources:
https://learn.microsoft.com/en-us/visualstudio/python/python-environments
Visual Studio How to add Python module to Intellisense

Editing autocomplete settings in Visual Studio 2013 (PTVS)

I am trying to switch from Pycharm to Visual Studio 2013 (PTVS), however I cannot find how to change settings for auto-completion popups. For example, in Pycharm whenever you start writing something, it automatically gives you a list of possible keywords, like in screenshots below.
If I start to write 'co' pycharm lets me choose 'consecutive' which is an already defined boolean. Is there any way to change these settings in visual studio? I have went through the settings menu like 20 times now, and I am completely stuck.
screenshot of pycharm:
http://i61.tinypic.com/20960wn.png
screenshot of visual studio 2013:
http://i62.tinypic.com/2qtilg1.png
I found the answer by myself - PTVS doesn't support this feature, however there is a plugin, which can be downloaded here, which supposedly fixes this issue:
http://visualstudiogallery.msdn.microsoft.com/644b4359-5eeb-4ba5-9374-78a8507761f0
However, after further inspection, it is broken and doesnt work half as good as pycharm's autocomplete. Most of the time it popups a message saying 'no suggestions' which becomes seriously annoying getting that msg after every single letter.
Bottomline - it is broken.
This is now supported with PTVS. Per the completions section found on the GitHub wiki.
Completions can be shown at any time by pressing Ctrl+J or Ctrl+Space, or may be triggered automatically by certain commands (such as import), operators (such as a period/full stop), or by typing at any place where completions are likely to be helpful.

IDE for Python ( like Visual Studio with visual assist X )? [duplicate]

This question already has an answer here:
What IDE to use for Python? [closed]
(1 answer)
Closed 9 years ago.
I use for C/C++ Visual studio 2012 with Visual Assist X plugin.
Now I'm going to learn Python. I need good IDE for Python and my main requirement
-very good intelli/autocomplete feature in IDE ( I don't like notepad or Python shell )
Can you recommended IDE for my requirement?
I struggled a lot before finding a good IDE for Python. At the moment I'm using PyCharm which has a lot of features I got used to with other languages and IDEs, such as very good syntax highlighting, code completion, structure navigation, documentation linking, VCS integration (with live diff tool) and so on.
Note: it's not free though, but you can do a free and full-features 30-days trial.
very good intelli/autocomplete feature in IDE
It will be very difficult to find a good IDE for python. The main reason is that your requirement is very very difficult to be achieved, if not downright impossible, due to the fact that python is dynamically bound, so utilities can not be certain about what goes where (as they do in a statically bound languages, such as java or c#) so as to create a reliable autocomplete feature in an IDE.
That said, in my opinion you might be better served using a plain text editor (vim quickly comes to mind, if you are on windows something along the lines of notepad++ will do) and then use the python vm of your choice to run and/or debug your code.
If you are so inclined to use an IDE nonetheless, Aptana studio (or just Eclipse with pydev) might prove adequate. Visual Studio is also a choice if you choose to pair it with Python tools for Visual studio.
You may use APTANA, Geany or ipython for your practice! I would prefer APTANA or GEANY
Eclipse is also a good IDE for python too!
WingIDE is my preferred ide. It has pretty good intelligent fill.
These days I go with Sublime Text for editing everything (http://www.sublimetext.com) and bpython (http://bpython-interpreter.org) as my Python shell.
Perhaps these other threads on Stack Overflow may be of additional help:
What IDE to use for Python?
https://stackoverflow.com/questions/126753/is-there-a-good-free-python-ide-for-windows
Which is the best IDE for Python For Windows
I also relatively new to python (1 month..) after struggling with idlex for a few weeks ,i found pyscripter and im very happy with it ,has almost perfect auto-complete for python! As big plus .. it made me stop wishing there where a version of netbeans for python !

Python3/MacOSX integration into pycharm

I have had trouble setting up the pycharm ide on my macosx10.7 with python3..
I have scoured every resource available and tried hundreds of approaches, at this point I must accept my incompetence and seek help via this channel.
In my research, I notice a lack of ground-up explanations on python integration into macosx and how to configure pycharm to import modules, run code within the editor, etc. If i ever solve this I will make a very detailed tutorial.
I have imported python3 successfully, it looks like it is linked appropriately from /sys/lib/frameworks to /usr/lib ...etc -- version control is working just fine.
I think my issue is either in setting environmental variables (tried the program to fix this and tried macports) and in the script needed to execute. it will catch errors throughout but final product does not run in python and returns printout of :
/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/Desktop/pythonpractice/Py_Ex/classes.py
Process finished with exit code 0
i really need to get this configuration sound for my python programming class. please help (I've been through every line of pycharm website) .. preferably is there a way to map it via terminal? thanks for anyone who took the time to read this.
Summary of the discussion above:
Python 3.2.2 installation was broken on this Mac, installing ActiveState Python 3.2.2 from scratch and configuring it in PyCharm has fixed the problem.
Python path to be used in PyCharm settings: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3
Incompatible third-party plug-ins may break PyCharm, uninstall/disable them in Preferences | Plugins.
Ensure the latest PyCharm version is installed.
User's code depends on the graphics.py module which was not in the project or in the PYTHONPATH. Putting it into the project has solved the problem.
Most likely the wrong Run/Debug configuration was used in PyCharm, the easiest way to run or debug such scripts is by using the editor context menu Run and Debug actions. PyCharm creates the configuration automatically and debugging works fine as shown of the screenshot:
If one wants to configure and debug it, he can use the code.zip file to get started.
Sorry for the comments mess above, but it was not possible to move it into chat as user had only 1 reputation point, hence not able to use the chat feature of StackOverflow.

Categories