我使用Macports在我的Mac上安装了各种版本的python.当我选择python 2.7 via时$ port select python python27,virtualenvwrapper工作得很好.
但是如果我选择另一个版本的python,即2.6,virtualenvwrapper会生成一条错误消息:ImportError:没有名为virtualenvwrapper.hook_loader的模块
我检查了我的.profile并且设置VIRTUALENVWRAPPER_PYTHON为/opt/local/bin/python,所以在我看来virtualenvwrapper应该工作,无论我选择了哪个python.
知道什么会导致virtualenvwrapper在切换python版本时生成.hook_loader错误吗?
我正在使用MacPorts并安装了python_select以在2.6和2.7之间切换.但由于某些原因,我现在运行时遇到"命令未找到"错误:
sudo python_select python26
Run Code Online (Sandbox Code Playgroud)
可能是$ PATH的问题?不知道在哪里寻找它.
我已经使用MacPorts卸载并重新安装了python_select,但它不会出现在/ opt/local/bin中.因此,我在尝试运行时遇到"未找到命令"错误.然而,MacPorts坚持认为它已安装.甚至尝试过卸载-f和port clean --all python_select.
是否有更激烈的步骤将其从MacPorts中删除并尝试重新安装?
尝试启动django服务器时,出现以下错误:
django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND "geos".
Run Code Online (Sandbox Code Playgroud)
我在Mac OS Lion上运行postgresql8.4.
我用Macports来安装PostGIS.这是$ port安装显示的内容:
postgis @ 1.5.2_1 + postgresql84 postgis @ 1.5.2_1 + postgresql90 postgis @ 1.5.3_0 + postgresql90 postgis @ 1.5.3_0 + postgresql91(active)
这是我在尝试确定我所拥有的PostGIS版本时得到的结果:
geodjango=# SELECT PostGIS_full_version();
ERROR: could not access file "$libdir/postgis-1.5": No such file or directory
CONTEXT: SQL statement "SELECT postgis_lib_version()"
PL/pgSQL function "postgis_full_version" line 11 at SQL statement
Run Code Online (Sandbox Code Playgroud) 我试图在virtualenv中运行Openblock,但问题是Openblock需要Django 1.2.5并且我已经在服务器上安装了Django 1.1.1.
$ python -c "import django;print django.get_version()" 返回1.1.1
激活virtualenv后,相同的命令返回1.2.5.到现在为止还挺好.
但是当我yolk -l在virtualenv中运行时,它显示1.1.1为活动,1.2.5为非活动.
在尝试运行./manage.py runserver或shell或任何其他命令时,我收到错误:您必须定义一个"默认"数据库.
我在virtualenv中运行它,settings.py包括DATABASE_NAME,以及主机,端口和引擎.django在哪里期待默认数据库的定义?
这是追溯:
(env)fox-ser01:common wmfox3$ ./manage.py shell
Traceback (most recent call last):
File "./manage.py", line 31, in <module>
execute_manager(settings)
File "/Users/wmfox3/Sites/photo_project/env/src/django/django/core/management/__init__.py", line 442, in execute_manager
utility.execute()
File "/Users/wmfox3/Sites/photo_project/env/src/django/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/wmfox3/Sites/photo_project/env/src/django/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/wmfox3/Sites/photo_project/env/src/django/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/Users/wmfox3/Sites/photo_project/env/src/django/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/Users/wmfox3/Sites/photo_project/env/src/django/django/core/management/commands/shell.py", line 46, in handle_noargs
from django.db.models.loading import get_models
File "/Users/wmfox3/Sites/photo_project/env/src/django/django/db/__init__.py", line 12, in <module>
raise ImproperlyConfigured("You must define …Run Code Online (Sandbox Code Playgroud) 有没有办法在Wordpress中使用post_thumbnail功能时确定图像的方向?我创建了两种不同的尺寸,我需要使用合适的尺寸,即
the_post_thumbnail( 'article-pic-horizontal' );
Run Code Online (Sandbox Code Playgroud)
要么
the_post_thumbnail( 'article-pic-vertical' );
Run Code Online (Sandbox Code Playgroud) django ×3
macports ×2
python ×2
geodjango ×1
macos ×1
postgresql ×1
virtualenv ×1
wordpress ×1