How can I import the csvsql to Python 2.7 - python-2.7

I have successfuly installed csvkit using conda install ...
However, when I try to import the libraries in Python 2.7 Spyder, I get error messages:
import csvsql
Traceback (most recent call last):
File "<ipython-input-5-303a60a6b1ac>", line 1, in <module>
import csvsql
ImportError: No module named csvsql
import csvkit
Traceback (most recent call last):
File "<ipython-input-7-ca8a99ae9834>", line 1, in <module>
import csvkit
ImportError: No module named csvkit
I looked at the documentation -- they describe the installation process but not how the library is loaded in Python.
Moreover, I had an analogous problem with httplib2. I installed it successfuly but when I tried to import it in Spyder I received an analogous error message (No module named httplib2).
(I use Anaconda 3 and Spyder on Windows 11)
Any ideas? Thank you in advance.

I asked this question on the csvkit GitHub / issues forum.
The answer given was: You should use agate on which csvkit now relies for all its operations. See https://github.com/wireservice/agate.
I'm with you -- it would be wonderful to use csvkit as a command-line tool and a library, but it's authors don't see it that way. The full issue: https://github.com/wireservice/csvkit/issues/670

Related

Why xlsxwriter module does not work like other modules?

Traceback (most recent call last):
File "F:TC.py", line 1, in <module>
import xlsxwriter
ImportError: No module named xlsxwriter
I am getting this error even after trying every possible answer given to this problem earlier.
I am using python 2.7 in windows
I have installed xlsxwriter using pip
I have tried reinstalling python shell but it doesn't work.

PyDSTool with anaconda not installing properly

I am trying to install PyDSTool with anaconda2 (conda install PyDSTool), which seems to go well. But when I open spyder and import PyDSTool, it gives me error
import PyDSTool
Traceback (most recent call last):
File "<ipython-input-1-a214100b00aa>", line 1, in <module>
import PyDSTool
File "/home/user/anaconda2/lib/python2.7/site-packages/PyDSTool/__init__.py", line 76, in <module>
raise RuntimeError("SciPy v0.5.1 or above is required")
RuntimeError: SciPy v0.5.1 or above is required
I tried to change parseUtils.py as per this suggestion: import of package PyDSTool doesn't work
but still the same error. I certainly have SciPy 1.0 and python 2.7.
I ran into this problem recently. The accepted answer here (PyDSTool do not recognize SciPy version) is still effective today at solving this problem.
Basically download PyDSTool from here (https://github.com/tkf/pydstool/tree/tkf) instead of sourceforge.

Error with 'from matplotlib.finance import quotes_historical_yahoo'

I'm reading a financial book about Python. In the book the author is importing historical stock prices from yahoo finance. The very first line of code:
from matplotlib.finance import quotes_historical_yahoo
Causes the following error:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from matplotlib.finance import quotes_historical_yahoo
ImportError: cannot import name quotes_historical_yahoo
I went to this link and downloaded the zipped file.
https://github.com/matplotlib/matplotlib
I unzipped everything into this folder:
C:\Python27\matplotlib
I opened the CMD window, naviagted to that folder, and entered this:
python setup.py install
That gives me this error.
Even the traditional pip install doesn't work for me.
Does anyone have any idea what's wrong? I'm using Windows 7 and Python 2.7.
Thanks.

Error in Installing PyEnchant package on Windows-7 (64bit) for spelling check

I'm using Windows-7, 64 bit PC. I want to perform spelling check for a text, using python. I tried to install PyEnchant package using "pip install pyenchant" command. It gets installed. but when I try to import enchant in ipython console, it gives error as "ImportError: cannot import name utils".
Is there any other method to install and use PyEnchant?
In [43]: import enchant
Traceback (most recent call last):
File "<ipython-input-43-be94a407aebb>", line 1, in <module>
import enchant
File "C:\Anaconda2\lib\site-packages\enchant\__init__.py", line 92, in <module>
from enchant import _enchant as _e
File "C:\Anaconda2\lib\site-packages\enchant\_enchant.py", line 55, in <module>
from enchant import utils
ImportError: cannot import name utils
It looks to me like you have not got the underlying C library Enchant installed. Pyenchant is just a python wrapper for the Enchant C library. You can either build and install the C library yourself get the code from http://www.abisource.com/projects/enchant/#download or as you ask if there is another way to install it use the pyenchant-1.6.6.win32.exe link on http://pythonhosted.org/pyenchant/download.html which will install the Enchant C library for you.

Cannot import pygame into python 2.7

I have tried to import pygame 1.9 into both Python 2.7 and 3.5. I used both Windows 8.1 and 10. In every case, it does not import the file. This is the message I get:
>>> import pygame
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
import pygame
File "C:\Python27\lib\site-packages\pygame\__init__.py", line 95, in <module>
from pygame.base import *
ImportError: DLL load failed: The specified module could not be found.
Pygame is in the python27\include\pygame directory. Any help would be greatly appreciated.
Please follow this question here. It should be an error with missing dlls.
ImportError: DLL load failed: The specified module could not be found