我遇到过这篇文章:Mac OSX 10.6上的Python mysqldb没有工作,看到了两个选项:
将MySQL客户端库添加到LD_LIBRARY_PATH
mysql_config --libs -L/usr/local/mysql/lib -lmysqlclient -lpthread
所以我不需要在这做任何事情.
成功安装django并运行virtualenvs环境并使用sqlite3创建项目.我想用mysql来管理数据库.
settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'blog', # Or path to database file if using sqlite3.
'USER': 'root', # Not used with sqlite3.
'PASSWORD': 'root', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for …Run Code Online (Sandbox Code Playgroud) 我安装了Fabric via pip.
得到pip:
sudo apt-get install python-pip
Run Code Online (Sandbox Code Playgroud)
得到面料:
sudo pip install fabric
Run Code Online (Sandbox Code Playgroud)
(当我尝试w/out sudo时失败,并警告我文档或测试中缺少文件).
现在我得到以下内容:
$ which fab
/usr/local/bin/fab
$
$ fab
bash: /usr/bin/fab: No such file or directory
Run Code Online (Sandbox Code Playgroud)
咦!?我想which搜索了PATHbash将使用的解决方案.我误会了什么吗?Fabric,Pip或Bash应该归咎于此吗?我如何解决它?
我知道现在我可以跑/usr/local/bin/fab或:
`which fab` deploy
Run Code Online (Sandbox Code Playgroud)
但我希望它能正确运行!
我尝试使用pip,easy_install和源代码安装Cython.我在OsX Maverics上犯了以下错误:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
我在用 Python 2.7.5
pip version 1.4.1
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个错误?
我在Python 3.4中安装igraph时遇到问题
在Python命令(c:\ Python34\python.exe)中我键入:
python -m pip install igraph
Run Code Online (Sandbox Code Playgroud)
我得到以下回报:
File "<stdin>", line 1
python -m pip install igraph
/\
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我一直在尝试安装NumPy,并且已经有了残酷的时间.无论我尝试什么,我都会收到异常错误.我用了这个命令
$pip install numpy
Run Code Online (Sandbox Code Playgroud)
但它抛出了这个错误
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/basecommand.py", line 246, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/commands/install.py", line 352, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/req/req_set.py", line 693, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/req/req_install.py", line 817, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/req/req_install.py", line 1018, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/wheel.py", line 269, in move_wheel_files
clobber(source, dest, False, fixer=fixer, filter=filter)
File "/Library/Python/2.7/site-packages/pip-6.1.1-py2.7.egg/pip/wheel.py", line 215, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst: …Run Code Online (Sandbox Code Playgroud) 我真的很难安装任何python模块(例如6,yahoo_finance),因为它们需要安装pip,但我不知道我是否已经拥有pip或者如何安装它.安装完成后,我不知道输入什么命令以及输入的位置.我可以在没有pip的情况下以任何其他方式安装这些模块吗?
我只是一个初学者,很抱歉,如果这有点基础.
提前致谢
跟着这里
我成功跑了:
pip install django-static-jquery==2.1.4
Run Code Online (Sandbox Code Playgroud)
但是,我无法正确地在Django中获取静态内容.我有一个简单的html页面:
<html>
{% load staticfiles %}
{% static 'static_jquery/js/jquery.js' %}
</html>
Run Code Online (Sandbox Code Playgroud)
每个网页.所有最终发生的事情都是我的HTML只是吐出这个:
/static/static_jquery/js/jquery.js
Run Code Online (Sandbox Code Playgroud)
而不是实际加载库.我正在使用默认的Django推出,所以我很好奇我在这个过程中缺少的是什么.
settings.py:
INSTALLED_APPS = ( ...
django_static_jquery,
)
Run Code Online (Sandbox Code Playgroud)
包括只是'jquery'不能像其他问题中提出的那样工作.
我的团队正在开始一个新的Python项目.我们将使用Git和一个中央存储库.每个开发人员都将使用本地virtualenv,并从中央仓库推送/拉动到本地仓库.
使用此设置,可能的情况如下:
我的问题是:如何在所有开发人员之间同步项目依赖项?
我考虑的方法:
之前任何git push的开发者进行git freeze > requirements.txt.该文件与代码一起被推送.
在任何之后git pull,开发人员执行git install -r requirements.txt.
这种做法是否可行?推荐吗?有更好的方法吗?
我使用Ubuntu 15.10和zsh(不知道是否可以提供帮助),
所以我尝试安装django:
pip install django
Downloading/unpacking django
Downloading Django-1.9.5-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
Successfully installed django
Cleaning up...
Run Code Online (Sandbox Code Playgroud)
一切正常。当我这样做pip freeze,我可以看到Django的安装。
然后:
django-admin startproject mysite
但是我遇到了这个问题:
zsh: command not found: django-admin
pip ×10
python ×7
django ×3
macos ×2
architecture ×1
bash ×1
command-line ×1
cython ×1
fabric ×1
git ×1
github ×1
installation ×1
jquery ×1
mlab ×1
mongodb ×1
mysql ×1
numpy ×1
python-3.4 ×1
ubuntu-15.10 ×1