The previous code requires scipy, so I installed scipy too (from ): Similarly, I could install other modules too. Then tried installing numpy – which worked! I uninstalled my 64-bit Python and reinstalled Python 32-bit. There’s only 32-bit version available on this official site, so I just tried installing that, but ended up with the following error saying python was not found in the registry: With pip, it gave me false hope looking as if everything was fine:īut then stopped out with errors (more on installing using command line later).Īfter lots of searching, I decided to try the numpy Windows installer available at. If you google ‘visual studio no module named numpy’ or ‘no module named numpy’ you’ll find tons of threads with various suggestions, including installing/upgrading pip (pip comes with 3.4), using easy_install and running other registry updates. VS kept complaining about “ No module named ‘numpy’.” and kept stopping at the import statement. X = np.array(,, ,, , ])įrom sklearn.naive_bayes import GaussianNB Following is the simple Python code I was trying to run (from the Udacity Machine Learning class): What I was having trouble was figuring out how to add external libraries and import these. Now you hit F5, it runs your Python code: net application.Ĭreating a new project creates a new. Basically you create a new Python project, very similar to how you would create a. Of course you’ll need to install Python first if you haven’t done so already – I installed 3.4 (64-bit initially – but had to revert to 32-bit later).Īt this point you should be able to create a Python project in Visual Studio – here is a good tutorial on how to create your first Python program in VS. I downloaded PTVS 2.1 VS 2013.msi since I’m on VS2013. The first thing you need to do is download PTVS from CodePlex. Coming from a C# background, I thought I’d give it a shot before trying out a totally new editor (I’ve moved onto Spyder now though). P圜harm by JetBrains seems pretty popular, but while I was Googling for Python editors, I came across Python Tools for Visual Studio. You can toggle it with Shift+ Alt+ Enter or with View -> Full Screen on the main menu.There seem to be various editors for Python and there are many articles online (e.g., this blog post) that discuss the features of the various editors. You may prefer to enable line numbers, or have your test runner always visible.Īs new items like Error List appear during usage, you can decide what to do with them.Īlso, if you prefer having items visible that use significant space, consider using Full Screen as a view that doesn’t contain those items when you need additional real estate. Tools -> Options -> Text Editor -> C# -> Advanced -> Deselect “Enter outlining mode when files open” Final notesĪt this point you may want to perform your own customizations.Tools -> Options -> Text Editor -> All Languages -> Scroll Bars -> Deselect “Show annotations over vertical scroll bar”.Tools -> Options -> Text Editor -> All Languages -> General -> Deselect “Navigation bar”.You can press F9 as a substitute, or right click -> Breakpoint context menu item. You’ll lose the ability to click the indicator margin area to set and remove breakpoints.Tools -> Options -> Text Editor -> General -> Deselect “Indicator margin”.Tools -> Options -> Text Editor -> General -> Deselect “Selector margin”.You can view the build progress in the Output window, which you can open quickly with Ctrl+ Alt+ o. You’ll lose the ability to see the build status indicator on the status bar.Tools -> Options -> Environment -> General -> Deselect “Show status bar”.Now, you can download and import this settings file with Tools -> Import and Export Settings…, or you can do the following:.You can press Alt to reveal the menu bar when necessary. Install the Hide Main Menu Visual Studio extension.If you prefer having Solution Explorer always visible, now is an OK time to Un-Auto Hide it.Tools -> Import and Export Settings… -> Reset all settings -> No, just reset settings, overwriting my current settings (or, save your existing settings if you’d like…) -> Web Development (Code Only).First, reset your settings with the Web Development (Code Only) settings. Here’s how to achieve the trimmed down screenshot above: If you want to simplify the UI, it’s possible to turn it into this: Here’s Visual Studio Community 2013 General settings defaults:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |