Ok, so I assume MySQLdb is functional, as "import MySQLdb" works, and I can see everything via dir(MySQLdb). Thanks for pointing out the obvious (shuffles feet).
So why does ZMySQLda say:
------------------------------------------------
Traceback (most recent call last):
File "C:\PROGRA~1\Zope\lib\python\OFS\Application.py", line 552, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "C:\PROGRA~1\Zope\lib\python\Products\ZMySQLDA\__init__.py", line 91, in ?
import DA
File "C:\PROGRA~1\Zope\lib\python\Products\ZMySQLDA\DA.py", line 91, in ?
from db import DB
File "C:\PROGRA~1\Zope\lib\python\Products\ZMySQLDA\db.py", line 89, in ?
import _mysql
ImportError: No module named _mysql
-------------------------------------------------
I can import _mysql in python.... ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Probably because you have a pre-built Zope installation, and MySQLdb is being installed in your system python tree, and Zope has it's own python. Copy the MySQLdb files into C:\PROGRA~1\Zope\lib\python\ This includes: MySQLdb directory/package and all contents, _mysql.pyd and _mysql_exceptions.py.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After copying the directories/files, I gave zserver a restart, and everything is ok. I had used the python.exe supplied by zope for the install, but it still dumped everything in Python21. Hrmph.
Thanks for the help, sure wish I had gcc on W2K...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2001-10-01
I am new to python and Zope. Can someone please help and spell it out for me? I have listed all the details. Feel free to make fun of me for making a stupid mistake..
Here is my general info:
Windows 2000 Professional
Zope 2.4.0 (installed @ c:\mysql)
MySQL 3.23.42 (installed @ c:\Zope)
Only the Zope installed Python.
ZMySQLDA 2.0.8
I do not have a C compiler, do I need one? (I am very new...)
Here are the steps that I followed:
1) Unzip MySQL-python-0.9.0.tar to C:\MySQL-python-0.9.0
2) Next I ran the setup script with the build parameter. This is the output:
C:\MySQL-python-0.9.0>c:\Zope\bin\python setup.py build
running build
running build_py
creating build
creating build\lib.win32-2.1
copying CompatMysqldb.py -> build\lib.win32-2.1
copying _mysql_exceptions.py -> build\lib.win32-2.1
creating build\lib.win32-2.1\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\sets.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-2.1\MySQLdb
creating build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.1\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-2.1
creating build\temp.win32-2.1\Release
cl.exe /c /nologo /Ox /MD /W3 /GX -Ic:\mysql\include -Ic:\zope\bin\Include /Tc_mysql.c /Fobuild\temp.win32-2.1\Release\_mysql.obj
error: command 'cl.exe' failed: No such file or directory
==========================================
3) Next I run the setup.py with the install parameter. Here is the output:
C:\MySQL-python-0.9.0>c:\zope\bin\python setup.py install
running install
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb\__init__.py (output up-to-date)
not copying MySQLdb\converters.py (output up-to-date)
not copying MySQLdb\connections.py (output up-to-date)
not copying MySQLdb\cursors.py (output up-to-date)
not copying MySQLdb\sets.py (output up-to-date)
not copying MySQLdb\times.py (output up-to-date)
not copying MySQLdb\constants\__init__.py (output up-to-date)
not copying MySQLdb\constants\CR.py (output up-to-date)
not copying MySQLdb\constants\FIELD_TYPE.py (output up-to-date)
not copying MySQLdb\constants\ER.py (output up-to-date)
not copying MySQLdb\constants\FLAG.py (output up-to-date)
not copying MySQLdb\constants\REFRESH.py (output up-to-date)
not copying MySQLdb\constants\CLIENT.py (output up-to-date)
running build_ext
building '_mysql' extension
cl.exe /c /nologo /Ox /MD /W3 /GX -Ic:\mysql\include -Ic:\zope\bin\Include /Tc_mysql.c /Fobuild\temp.win32-2.1\Release\_mysql.obj
error: command 'cl.exe' failed: No such file or directory
==========================================
4) This is where things get messed up - if I didn't already mess things up...
I have a directory within the build directory called "lib.win32-2.1". I have the _mysql_exceptions.py file, but I don't have the _mysql.pyd file. I copy all the contents of the "lib.win32-2.1" directory to the "c:\Zope\lib\python" directory.
5) Restart Zope (I have it running as a service)
6) Extract "ZMySQLDA-2.0.8.tar.gz" to "c:\zope"
7) Restart Zope (I have it running as a service)
8) ZMySQLDA is broke. I have the following error message:
Import Traceback
Traceback (most recent call last):
File "C:\Zope\lib\python\OFS\Application.py", line 552, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "C:\Zope\lib\python\Products\ZMySQLDA\__init__.py", line 91, in ?
import DA
File "C:\Zope\lib\python\Products\ZMySQLDA\DA.py", line 92, in ?
from db import DB
File "C:\Zope\lib\python\Products\ZMySQLDA\db.py", line 89, in ?
import _mysql
ImportError: No module named _mysql
==========================================
Thanks,
Bryant
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
error: command 'cl.exe' failed: No such file or directory
You don't have a C compiler.
Try http://dustman.net/andy/python/MySQLdb for a link to a Windows installer. When I release 0.9.1, I will likely have a Windows installer on SourceForge. That should be real soon now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2001-10-01
Thank a million.
For anyone else having problems, here are the steps I took:
1) Installed Python 2.1
2) Installed MySQLdb with the Windows installer
3) Coppied the following files from my Python 2.1 directory to c:\zope\lib\python:
CompatMysqldb.py
CompatMysqldb.pyc
CompatMysqldb.pyo
_mysql.pyd
_mysql_exceptions.py
_mysql_exceptions.pyc
_mysql_exceptions.pyo
MySQLdb (the entire directory)
==========================================
4) Installed ZMySQLDA
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know, windoze is not supported, BillG is evil, all that stuff. But I gotta get this going on a test server at work, or else -;^>=
FWIW, everything works peachy on a RH7.1 ...
Now, when I run python (with setup.py build) I get:
-----------------------------------------------
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb\__init__.py (output up-to-date)
not copying MySQLdb\converters.py (output up-to-date)
not copying MySQLdb\connections.py (output up-to-date)
not copying MySQLdb\cursors.py (output up-to-date)
not copying MySQLdb\sets.py (output up-to-date)
not copying MySQLdb\times.py (output up-to-date)
not copying MySQLdb\constants\__init__.py (output up-to-date)
not copying MySQLdb\constants\CR.py (output up-to-date)
not copying MySQLdb\constants\FIELD_TYPE.py (output up-to-date)
not copying MySQLdb\constants\ER.py (output up-to-date)
not copying MySQLdb\constants\FLAG.py (output up-to-date)
not copying MySQLdb\constants\REFRESH.py (output up-to-date)
not copying MySQLdb\constants\CLIENT.py (output up-to-date)
running build_ext
building '_mysql' extension
cl.exe /c /nologo /Ox /MD /W3 /GX -Id:\mysql\include -IC:\Python21\Include /Tc_mysql.c /Fobuild\temp.win32-2.1\Release\_mysql.obj
error: command 'cl.exe' failed: No such file or directory
----------------------------------------------
Anybody have any ideas? I installed using the windows binary (linked to from the sourceforge page) and could import _mysql, but that was it...
Looks suspiciously like you don't have a C compiler. If you have the binary, and can import _mysql, can you import MySQLdb?
[forehead slap]
Ok, so I assume MySQLdb is functional, as "import MySQLdb" works, and I can see everything via dir(MySQLdb). Thanks for pointing out the obvious (shuffles feet).
So why does ZMySQLda say:
------------------------------------------------
Traceback (most recent call last):
File "C:\PROGRA~1\Zope\lib\python\OFS\Application.py", line 552, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "C:\PROGRA~1\Zope\lib\python\Products\ZMySQLDA\__init__.py", line 91, in ?
import DA
File "C:\PROGRA~1\Zope\lib\python\Products\ZMySQLDA\DA.py", line 91, in ?
from db import DB
File "C:\PROGRA~1\Zope\lib\python\Products\ZMySQLDA\db.py", line 89, in ?
import _mysql
ImportError: No module named _mysql
-------------------------------------------------
I can import _mysql in python.... ?
Probably because you have a pre-built Zope installation, and MySQLdb is being installed in your system python tree, and Zope has it's own python. Copy the MySQLdb files into C:\PROGRA~1\Zope\lib\python\ This includes: MySQLdb directory/package and all contents, _mysql.pyd and _mysql_exceptions.py.
You da man! Er, I mean
You da adustman!
After copying the directories/files, I gave zserver a restart, and everything is ok. I had used the python.exe supplied by zope for the install, but it still dumped everything in Python21. Hrmph.
Thanks for the help, sure wish I had gcc on W2K...
I am new to python and Zope. Can someone please help and spell it out for me? I have listed all the details. Feel free to make fun of me for making a stupid mistake..
Here is my general info:
Windows 2000 Professional
Zope 2.4.0 (installed @ c:\mysql)
MySQL 3.23.42 (installed @ c:\Zope)
Only the Zope installed Python.
ZMySQLDA 2.0.8
I do not have a C compiler, do I need one? (I am very new...)
Here are the steps that I followed:
1) Unzip MySQL-python-0.9.0.tar to C:\MySQL-python-0.9.0
2) Next I ran the setup script with the build parameter. This is the output:
C:\MySQL-python-0.9.0>c:\Zope\bin\python setup.py build
running build
running build_py
creating build
creating build\lib.win32-2.1
copying CompatMysqldb.py -> build\lib.win32-2.1
copying _mysql_exceptions.py -> build\lib.win32-2.1
creating build\lib.win32-2.1\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\sets.py -> build\lib.win32-2.1\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-2.1\MySQLdb
creating build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-2.1\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.1\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-2.1
creating build\temp.win32-2.1\Release
cl.exe /c /nologo /Ox /MD /W3 /GX -Ic:\mysql\include -Ic:\zope\bin\Include /Tc_mysql.c /Fobuild\temp.win32-2.1\Release\_mysql.obj
error: command 'cl.exe' failed: No such file or directory
==========================================
3) Next I run the setup.py with the install parameter. Here is the output:
C:\MySQL-python-0.9.0>c:\zope\bin\python setup.py install
running install
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb\__init__.py (output up-to-date)
not copying MySQLdb\converters.py (output up-to-date)
not copying MySQLdb\connections.py (output up-to-date)
not copying MySQLdb\cursors.py (output up-to-date)
not copying MySQLdb\sets.py (output up-to-date)
not copying MySQLdb\times.py (output up-to-date)
not copying MySQLdb\constants\__init__.py (output up-to-date)
not copying MySQLdb\constants\CR.py (output up-to-date)
not copying MySQLdb\constants\FIELD_TYPE.py (output up-to-date)
not copying MySQLdb\constants\ER.py (output up-to-date)
not copying MySQLdb\constants\FLAG.py (output up-to-date)
not copying MySQLdb\constants\REFRESH.py (output up-to-date)
not copying MySQLdb\constants\CLIENT.py (output up-to-date)
running build_ext
building '_mysql' extension
cl.exe /c /nologo /Ox /MD /W3 /GX -Ic:\mysql\include -Ic:\zope\bin\Include /Tc_mysql.c /Fobuild\temp.win32-2.1\Release\_mysql.obj
error: command 'cl.exe' failed: No such file or directory
==========================================
4) This is where things get messed up - if I didn't already mess things up...
I have a directory within the build directory called "lib.win32-2.1". I have the _mysql_exceptions.py file, but I don't have the _mysql.pyd file. I copy all the contents of the "lib.win32-2.1" directory to the "c:\Zope\lib\python" directory.
5) Restart Zope (I have it running as a service)
6) Extract "ZMySQLDA-2.0.8.tar.gz" to "c:\zope"
7) Restart Zope (I have it running as a service)
8) ZMySQLDA is broke. I have the following error message:
Import Traceback
Traceback (most recent call last):
File "C:\Zope\lib\python\OFS\Application.py", line 552, in import_product
product=__import__(pname, global_dict, global_dict, silly)
File "C:\Zope\lib\python\Products\ZMySQLDA\__init__.py", line 91, in ?
import DA
File "C:\Zope\lib\python\Products\ZMySQLDA\DA.py", line 92, in ?
from db import DB
File "C:\Zope\lib\python\Products\ZMySQLDA\db.py", line 89, in ?
import _mysql
ImportError: No module named _mysql
==========================================
Thanks,
Bryant
error: command 'cl.exe' failed: No such file or directory
You don't have a C compiler.
Try http://dustman.net/andy/python/MySQLdb for a link to a Windows installer. When I release 0.9.1, I will likely have a Windows installer on SourceForge. That should be real soon now.
Thank a million.
For anyone else having problems, here are the steps I took:
1) Installed Python 2.1
2) Installed MySQLdb with the Windows installer
3) Coppied the following files from my Python 2.1 directory to c:\zope\lib\python:
CompatMysqldb.py
CompatMysqldb.pyc
CompatMysqldb.pyo
_mysql.pyd
_mysql_exceptions.py
_mysql_exceptions.pyc
_mysql_exceptions.pyo
MySQLdb (the entire directory)
==========================================
4) Installed ZMySQLDA