Python dogpile.cache“没有名为fcntl的模块”错误
我正在使用Python2.7和SQLAlchemy。 我在试着看看是否可以使用Dogpile.Cache。 我已经使用Python dogpile.cache“没有名为fcntl的模块”错误,python,sqlalchemy,dogpile.cache,Python,Sqlalchemy,Dogpile.cache,我正在使用Python2.7和SQLAlchemy。 我在试着看看是否可以使用Dogpile.Cache。 我已经使用 pip install dogpile.cache 但是当我尝试运行SQLAlchemy给出的示例时 我一直在担心:没有名为fcntl的模块。我认为最新的狗堆缓存解决了windows问题 有人能帮忙吗? 多谢各位 更新 好的,示例是创建数据库和缓存。但当它试图使用FromCache加载数据时,它给了我一个错误 people=Session.queryPerson.option
pip install dogpile.cache
但是当我尝试运行SQLAlchemy给出的示例时
我一直在担心:没有名为fcntl的模块。我认为最新的狗堆缓存解决了windows问题
有人能帮忙吗?
多谢各位
更新
好的,示例是创建数据库和缓存。但当它试图使用FromCache加载数据时,它给了我一个错误
people=Session.queryPerson.options fromCacheDefault.all
这是回溯
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Users\JKIM\Downloads\DogpileCacheTest\examples\dogpile_caching\helloworld.py", line 13, in <module>
people = Session.query(Person).options(FromCache("default")).all()
File "build\bdist.win-amd64\egg\sqlalchemy\orm\query.py", line 2613, in all
File "examples\caching_query.py", line 63, in __iter__
return self.get_value(createfunc=lambda: list(Query.__iter__(self)))
File "examples\caching_query.py", line 108, in get_value
expiration_time=expiration_time
File "C:\Python27\lib\site-packages\dogpile\cache\region.py", line 657, in get_or_create
async_creator) as value:
File "C:\Python27\lib\site-packages\dogpile\lock.py", line 154, in __enter__
return self._enter()
File "C:\Python27\lib\site-packages\dogpile\lock.py", line 87, in _enter
value = value_fn()
File "C:\Python27\lib\site-packages\dogpile\cache\region.py", line 610, in get_value
value = self.backend.get(key)
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 220, in get
with self._dbm_file(False) as dbm:
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 212, in _dbm_file
with self._use_rw_lock(write):
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 207, in _use_rw_lock
with self._rw_lock.read():
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 327, in read
self.acquire_read_lock(True)
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 408, in acquire_read_lock
return self._acquire(wait, os.O_RDONLY, self._module.LOCK_SH)
File "C:\Python27\lib\site-packages\dogpile\util\langhelpers.py", line 63, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "C:\Python27\lib\site-packages\dogpile\cache\backends\file.py", line 400, in _module
import fcntl
ImportError: No module named fcntl
您使用的是什么操作系统?我使用的是Windows 7 python模块fcntl是一个仅限Unix的模块。您不能使用使用仅具有Unix功能的python模块的软件。是的,我在bitbucket中找到了此问题,并已解决。我安装的最新版本是0.6.1,这个问题应该得到解决,但似乎我无法让它正常工作。我对这个问题的理解是,不会添加修复程序:Windows只是没有一个,对于这类事情,人们普遍接受的方法,我不想认可其中一种。您使用的是什么操作系统?我使用的是Windows 7 python模块fcntl是一个仅限Unix的模块。您不能使用使用仅具有Unix功能的python模块的软件。是的,我在bitbucket中找到了此问题,并已解决。我安装的最新版本是0.6.1,这个问题应该得到解决,但似乎我无法让它工作。我对这个问题的理解是,不会添加修复程序:Windows只是没有一个单一的、被广泛接受的方法来解决这类问题,我也没有兴趣认可其中一个。