草庐IT

PACKAGES

全部标签

python - 导入 pandas.DataFrame 时获取 "IOError: [Errno 13] Permission denied:.."

我得到了IOError:[Errno13]Permissiondenied:'/usr/local/lib/python2.7/dist-packages/python_dateutil-2.2-py2.7.egg/EGG-INFO/top_level.txt'当我尝试导入Pandas时。我不明白为什么。在python3控制台中导入pandas就可以了。代码的执行也是用Python3完成的start_simulation.pyfromMarketimportMarketfromTestingAlgorithmimportTestingAlgorithmfromLiteForexHand

python - 为什么我得到这个 NameError : name 'url_for' is not defined?

关闭。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭5年前。Improvethisquestion我正尝试按照flask教程的说明构建URLhttp://flask.pocoo.org/docs/0.11/quickstart/但是我一直收到这个NameErrorname'url_for'isnotdefined这是代码:fromflaskimportFlaskapp=Flask(__name_

python - Django 管理中的 MultiValueDictKeyError

更新型号:classPicturesManager(models.Manager):defcreate_pictures(self,flat,img):pictures=self.create(car=car,image=img)returnpicturesdefget_file_path(instance,filename):filename="%s.%s"%(uuid.uuid4(),filename.split('.')[-1])returnos.path.join('car_img/',filename)classPictures(models.Model):car=model

python - 导入错误 : No module named rest_framework. 授权 token

我在我的项目中使用djangorest-framework(DRF)token身份验证来在创建用户时创建token。在我从DRF文档中添加这一行之前,一切都很好:url(r'^api-token-auth/','rest_framework.authtoken.views.obtain_auth_token'),创建一个端点,在正确发布用户名和密码后为用户返回token。它抛出这个错误:ImportError:Nomodulenamedrest_framework.authtoken这很奇怪,因为DRF没有这一行就可以了,所以它必须包含在我的PYTHONPATH中。我还运行了pytho

python - Mayavi 不从 Spyder : complains about "ValueError: API ' QString' . 中运行......"

我无法从SpyderIDE中运行/使用Mayavi库。我已经在下面描述了这个问题。任何帮助都会非常有用。(提前非常感谢。)重现问题的步骤:只需在脚本中导入Mayavi库(例如使用“importmayavi.mlabasmlab”)并执行脚本即可重现此问题。我在此处包含一个测试代码(请注意,此代码是来自Mayavi网站的示例代码)以重现该问题:代码fromnumpyimportsin,cos,mgridimportmayavi.mlabasmmlabdeff(x,y):returnsin(x+y)+sin(2*x-y)+cos(3*x+4*y)x,y=mgrid[-7.:7.05:0.0

python - 更新anaconda和安装新包的问题

我正在尝试在Ubuntu-Linux上的anaconda上安装seaborn。condainstall-canacondaseaborn=0.7.1我收到以下错误消息:Fetchingpackagemetadata.../home/moritz/Python/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py:337:SubjectAltNameWarning:Certificateforconda.anaconda.orghasno`subjectAltName`,fallingb

python - Mac 操作系统, pip : specify compiler for packages containing C libraries

我在使用pip使用默认的clang编译器编译mapscript(是来自pypi的包含C代码的包)时遇到了一些问题。这是我的尝试:-$sudopipinstallmapscriptPassword:Downloading/unpackingmapscriptRunningsetup.pyegg_infoforpackagemapscriptRequirementalreadysatisfied(use--upgradetoupgrade):distributein/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib

python - "PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.5/site-packages '"安装Django

我无法在Ubuntu上安装基本的Django包。我刚刚删除了virtualenv并重新制作了它。pip3install=pip3install-rrequirements.txt[mything]cchilders@cchilders-desktop:~/projects/mything(master)$catrequirements.txtDjango==1.10.1django-filterdjangorestframeworkpsycopg2twilioipdbipython[mything]cchilders@cchilders-desktop:~/projects/mythi

python - RabbitMQ IOError : Socket closed

我有一个RabbitMQ消息代理和一个远程Celeryworker。它工作正常,但大约每五分钟我就会收到此错误:[2014-01-0614:02:27,247:WARNING/MainProcess]consumer:Connectiontobrokerlost.Tryingtore-establishtheconnection...Traceback(mostrecentcalllast):File"/usr/local/ABCD/venv/local/lib/python2.7/site-packages/celery/worker/consumer.py",line270,ins

python - python2 存在 site-packages 文件夹,python3 不存在

作为root用户,我看到:root@5d6f29f1d4e9:/usr/local/lib/python2.7#ls-a...dist-packagessite-packagesroot@5d6f29f1d4e9:/usr/local/lib/python3.6#ls-a...dist-packages当我运行这个时:find/-typed-name'site-packages'唯一的结果是:/usr/local/lib/python2.7/site-packages有谁知道为什么我在3.6中看不到站点包?我安装了python3:aptinstall-ybuild-essentiall