草庐IT

directory1

全部标签

python 3 : module in same directory as script: "ImportError: No module named"

我正在尝试从IPythonshell导入一个模块(venues)。venues模块已正确导入,但它随后尝试自行导入名为makesoup的模块,但未能成功。我位于~目录中,并正在尝试导入位于子目录processors中的venues.py文件。makesoup.py文件也位于processors子目录中,这意味着它附近的任何Python脚本都应该能够找到它,对吧?In[1]:importprocessors.venues---------------------------------------------------------------------------ImportErro

python日志记录: how to ensure logfile directory is created?

我想在我的应用程序中使用python的日志框架,并且我想允许我的应用程序的最终用户指定日志文件。(通过Python日志记录框架的configurationmechanisms,在我的例子中,它是YAML文件的一部分,最终用户可以编辑它来指定日志记录的行为方式。)有没有办法让日志框架通过创建一个目录来确保它存在?因为日志文件名的确切路径嵌入在最终用户指定的配置信息中,所以它对于作为应用程序编写者的我来说,解析这些信息以确定应该创建哪个目录是非常重要的。如果最终用户指定“foo/bar/baz.log”,我想确保创建了foo/bar目录。注意:这是thisSOquestionaboutJa

python - pip install mysqlclient 返回 "fatal error C1083: Cannot open file: ' mysql.h' : No such file or directory

这是这个问题:我尝试像这样安装mysqlclientC:\Users\amccommon349>pipinstallmysqlclientCollectingmysqlclientUsingcachedhttps://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gzInstallingcollectedpackages:mysqlclientRunningsetup.pyinstallfo

python - IOError : [Errno 2] No such file or directory trying to open a file

这个问题在这里已经有了答案:open()givesFileNotFoundError/IOError:Errno2Nosuchfileordirectory(8个回答)Whydoesn'tcallingastringmethod(suchas.replace)modify(mutate)thestring?Whydoesn'titchangeunlessIassigntheresult?(3个回答)关闭2个月前。我对Python很陌生,所以请原谅以下基本代码和问题,但我一直在试图找出导致我遇到错误的原因(我什至在S.O.上查看过类似的线程)但不能解决我的问题。这是我想要做的:循环浏览包

python - libpython2.7.so.1.0 : cannot open shared object file: No such file or directory

我试图从终端运行python脚本但收到下一条错误消息:ImportError:libpython2.7.so.1.0:cannotopensharedobjectfile:Nosuchfileordirectory如果我运行printsys.version我会得到:>>>importsys>>>printsys.version2.7.3(default,Feb262013,16:27:39)[GCC4.4.620120305(RedHat4.4.6-4)]如果我运行ldd/usr/local/bin/python>>ldd/usr/local/bin/pythonlinux-vdso.

Python distutils 错误 : "[directory]... doesn' t exist or not a regular file"

让我们采用以下项目布局:$ls-R..:packagesetup.py./package:__init__.pydirfile.datmodule.py./package/dir:tool1.dattool2.datsetup.py的内容如下:$catsetup.pyfromdistutils.coreimportsetupsetup(name='pyproj',version='0.1',packages=['package',],package_data={'package':['*','dir/*',],},)如您所见,我想在package/和package/dir/目录中包含所

python - pip安装错误 "No such file or directory: setup.py"

我收到安装错误,因为pip找不到setup.py。sudopipinstallhttps://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl我收到此错误消息。Downloading/unpackinghttps://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whlDownloadingtensorflow-0.5.0-cp27-none

python - 无法打开包含文件 : 'io.h' : No such file or directory

我试图使用Cython编译一个简单的.pyx文件。print("hello")这是我的setup.py:fromdistutils.coreimportsetupfromCython.Buildimportcythonizesetup(ext_modules=cythonize("hello.pyx"))然后我运行命令。pythonsetup.pybuild_ext--inplace错误如下所示。我一直在努力搜索它,但没有发现任何帮助。runningbuild_extbuilding'hello'extensionC:\ProgramFiles(x86)\MicrosoftVisual

mongodb错误: how do I make sure that your journal directory is mounted

我在我的mac终端上输入mongod并得到以下错误:2015-04-27T22:11:46.471-0400W-[initandlisten]Detecteduncleanshutdown-/data/db/mongod.lockisnotempty.2015-04-27T22:11:46.479-0400ISTORAGE[initandlisten]**************oldlockfile:/data/db/mongod.lock.probablymeansuncleanshutdown,buttherearenojournalfilestorecover.thisisli

mongodb错误: how do I make sure that your journal directory is mounted

我在我的mac终端上输入mongod并得到以下错误:2015-04-27T22:11:46.471-0400W-[initandlisten]Detecteduncleanshutdown-/data/db/mongod.lockisnotempty.2015-04-27T22:11:46.479-0400ISTORAGE[initandlisten]**************oldlockfile:/data/db/mongod.lock.probablymeansuncleanshutdown,buttherearenojournalfilestorecover.thisisli