3

I just installed Python 3.5.2. I am working in the shell/IDLE environment and attempting to import Pandas.

However when I write: import pandas

I get the following:

Traceback (most recent call last):
  File "C:/Users/bartogre/Desktop/Program1.py", line 1, in <module>
    import pandas
ImportError: No module named 'pandas'

How do I add any module to the library Python 3.5.2 is reading? I do not want to work in Anaconda.

I watched this video: https://www.youtube.com/watch?v=ddpYVA-7wq4

And below is my output from CMD:

C:\Users\bartogre>
C:\Users\bartogre>cd c:\users\bartogre\desktop\pyodbc-master
c:\Users\bartogre\Desktop\pyodbc-master>python setup.py
c:\Users\bartogre\Desktop\pyodbc-master>python setup.py install

'git' is not recognized as an internal or external command,
operable program or batch file.
WARNING: git describe failed with: 1
WARNING: Unable to determine version.  Using 3.0.0.0
C:\Program Files (x86)\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.5.egg\s
etuptools\dist.py:340: UserWarning: The version specified ('3.0.0-unsupported')
is an invalid version, this may not work as expected with newer versions of setu
ptools, pip, and PyPI. Please see PEP 440 for more details.
running install
running bdist_egg
running egg_info
writing pyodbc.egg-info\PKG-INFO
writing dependency_links to pyodbc.egg-info\dependency_links.txt
writing top-level names to pyodbc.egg-info\top_level.txt
reading manifest file 'pyodbc.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyodbc.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++
Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
4
  • pandas.pydata.org/pandas-docs/version/0.18.1/install.html Commented Sep 29, 2016 at 13:26
  • Hard to give you a decent answer without knowing what install method you already tried. Commented Sep 29, 2016 at 15:49
  • Hey - updated the question. I am guessing I need to install landinghub.visualstudio.com/visual-cpp-build-tools? Commented Sep 29, 2016 at 18:06
  • In previous versions for Python 3.4 you had to install Microsoft Visual C++ Express 2010 in order to provide the needed C++ compiler. Due to that I assume that installing C++ build tools might be the equivalent solution for the same issue related with newer versions since the MS homepage states They are the same tools that you find in Visual Studio 2015 in a scriptable standalone installer. Commented Sep 29, 2016 at 22:28

2 Answers 2

2

A bit of background: a system can have multiple Python installations. On Windows, each is a directory with python.exe and Lib/site-packages/. To use a package with a particular python.exe, you must install into the corresponding site-packages.

In your case, 'python' invokes 'C:\Program Files (x86)\Anaconda3\python.exe'. Do you have another python installation that you want to be working with?

In any case, the current standard way to install packages on Windows is with pip. The best way to run it in the console is

some/path> <some python> -m pip install package 

where <some python> is either python to invoke the default install or something else to get another install. Pip first goes to pypi.python.org to find the package. If the package contains C code, it may find an appropriate pre-built binary or try to compile locally, which requires the correct version of Visual C++ compiler.

If pip does not find a pre-built binary for your install, I would do the following. For about 200 packages, unofficial binaries are available at http://www.lfd.uci.edu/~gohlke/pythonlibs/. The site has been up for up, and a livesave for Windows users, for at least a decade and I and many others have used it. Cristoph gives instructions on how to download a file and then use pip to install it.

Sign up to request clarification or add additional context in comments.

3 Comments

@ Terry - I am trying to install the modules to Python 3.5 located here: C:\Users\bartogre\AppData\Local\Programs\Python\Python35-32\ What is PIP? A web search takes me to pypi.python.org/pypi/pip If I read your answer correctly I would need to.... 1) Install PIP 2) Run the command C:\Users\bartogre\AppData\Local\Programs\Python\Python35-32\> <python.exe> -m pip install pandas 3) Done?
pip = python installer program, or something like that. To solve the bootstrap problem -- how to install the installer, a version of pip is included with the PSF python.org installer. '-m pip' runs the installed pip package. So skip 1). Note that the installed pip can update itself. <python> -m pip -h will display general help message. pip install -h will display install-specific help. Try 2).
If 2) does not work because it cannot compile, use the alternative I outlined to get a compiled binary ready to install. pip installs 'wheels', denoted xyz.whl, I believe.
1

This is all great feedback - I installed via the conda. And, I am using Spyder over the ILDE environment. Please the below from CMD.

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>conda install pyodbc Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: .... Solving package specifications: .........

Package plan for installation in environment C:\Users\Hal\Anaconda3:

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
conda-env-2.6.0            |                0          498 B
python-3.5.2               |                0        30.3 MB
pyodbc-3.0.10              |           py35_1          48 KB
ruamel_yaml-0.11.14        |           py35_0         217 KB
conda-4.2.9                |           py35_0         428 KB
------------------------------------------------------------
                                       Total:        31.0 MB

The following NEW packages will be INSTALLED:

pyodbc:      3.0.10-py35_1
ruamel_yaml: 0.11.14-py35_0

The following packages will be UPDATED:

conda:       4.0.5-py35_0 --> 4.2.9-py35_0
conda-env:   2.4.5-py35_0 --> 2.6.0-0
python:      3.5.1-4      --> 3.5.2-0

Proceed ([y]/n)? y

Fetching packages ... conda-env-2.6. 100% |###############################| Time: 0:00:00 0.00 B/s python-3.5.2-0 100% |###############################| Time: 0:00:20 1.56 MB/s pyodbc-3.0.10- 100% |###############################| Time: 0:00:00 788.82 kB/s ruamel_yaml-0. 100% |###############################| Time: 0:00:00 837.06 kB/s conda-4.2.9-py 100% |###############################| Time: 0:00:00 969.21 kB/s Extracting packages ... [ COMPLETE ]|##################################################| 100% Unlinking packages ... [ COMPLETE ]|##################################################| 100% Linking packages ... [ COMPLETE ]|##################################################| 100%

C:\Windows\system32>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.