Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Ironpython(visual studio/PTVS)中使用psycopg2_Ironpython_Psycopg2_Ptvs - Fatal编程技术网

在Ironpython(visual studio/PTVS)中使用psycopg2

在Ironpython(visual studio/PTVS)中使用psycopg2,ironpython,psycopg2,ptvs,Ironpython,Psycopg2,Ptvs,我是Python的新手,我正在尝试将Ironpython与PTV结合使用来访问Postgres数据库。 我之前安装了Pythonx、y和psycopg2,并成功地使用了它们。然而,意识到使用TKinter创建GUI是多么痛苦,我决定转向Ironpython和PTV,因为WPF GUI更容易,我不需要将脚本移植到其他系统 因此,在安装了PTV和ironpython之后,我在VisualStudio中创建了一个项目,并在搜索路径部分添加了Pythonx解释器安装中的psycopg2包的路径。然后我尝

我是Python的新手,我正在尝试将Ironpython与PTV结合使用来访问Postgres数据库。 我之前安装了Pythonx、y和psycopg2,并成功地使用了它们。然而,意识到使用TKinter创建GUI是多么痛苦,我决定转向Ironpython和PTV,因为WPF GUI更容易,我不需要将脚本移植到其他系统

因此,在安装了PTV和ironpython之后,我在VisualStudio中创建了一个项目,并在搜索路径部分添加了Pythonx解释器安装中的psycopg2包的路径。然后我尝试了一个简单的hello world,导入了psycopg2,但在导入过程中出现了一个错误

我的代码:

import psycopg2
print "hello world"
我得到的错误是:

    An Exception of type 'IronPython.Runtime.Exceptions.ImportException' occured in Snippets.debug.scripting but was not handled in user code
Additional information: cannot import _psycopg from psycopg2
我在某个地方读到,我打算创建一个包含psycopg2的虚拟环境,但我不知道如何做到这一点

如果有人能帮我解决这个问题,那就太棒了


感谢堆

我忘了提及,我使用的是Windows 7。