1

I'm taking an online class to learn python, and I skipped a section that was giving me trouble because I had to install something that Visual Studio 2017 doesn't seem to recognize. Now that I've pretty far into the course, if not almost done, I wanted to figure out what's going on. I'm pretty sure Visual Studio 2017 is where the problem is.

What I'm trying to install is pytz. As far as my computer is concerned, it is downloaded. However, when I run a program in Visual Studio and import pytz, it says pytz is not a module it recognizes.

Is there a way to give Visual Studio a path to what I had downloaded? I looked in the Visual Studio 2017 installer and never saw any mention of pytz in any of the options. Any help is appreciated.

Ironmonger
  • 11
  • 4
  • strictly [**no screen shots**](http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557). – Srini V Nov 22 '17 at 14:44
  • Hi, what's your VS 2017 version? Please check this doc: https://learn.microsoft.com/en-us/visualstudio/python/installation and install the workload Python development and Data science and analytical applications workload which are available only with Visual Studio 2017 release 15.2 and later. – Sara Liu - MSFT Nov 23 '17 at 09:12
  • I have nearly everything I can from both downloaded aside from those that appear outdated (like Python 2 options). My version is 15.4. I still can't get my program to recognize pytz. is there a specific check box in either of those that I need to make sure MUST be checked? – Ironmonger Nov 26 '17 at 04:39
  • What's your OS version? I tried to install the Python development for VS 2017 on the windows 10, it works fine and I can create the python application. – Sara Liu - MSFT Nov 27 '17 at 08:41
  • I'm able to make python applications just fine. What I'm failing to get is the PYTZ module. When I type "import pytz" it says it has no idea what pytz is. I can write entire python codes that don't need pytz just fine. Python as a language isn't the problem. – Ironmonger Nov 27 '17 at 16:45

1 Answers1

-1

This link was useful to me, to install pytz in visual studio.

Can pip be used with Python Tools in Visual Studio?

Basically, go to Tools->Python -> Python environments. Once you select the right version of Python (for me is 3.6 64 bits), you will see a menu with options: Overview, Packages, Intellisense Click on Packages and you'll see a search input box. Put pytz there. Once the system found it, double click to install it.

Afterwards, you'll need to refresh DB on intellisense option under Python environments to make pytz available. On this way, pytz will be recognized.