the python path in your debug_将.egg添加到osx中的python路径(Add an .egg to the python path in osx)...

将.egg添加到osx中的python路径(Add an .egg to the python path in osx)

我正在使用PyCharm并使用PyDev设置远程调试。 现在一切准备就绪,除非我想调试它,告诉我在PyCharm控制台中的这条消息:

Warning: wrong debugger version. Use pycharm-debugger.egg from PyCharm installation folder.

所以我正在使用Python的virtualenv,所以我登录了virtualenv并将Python路径设置为.egg(我将.egg复制到我的文档以使其更容易)。

PYTHONPATH="$PYTHONPATH:./Documents/pycharm-debug.egg"

要么

PYTHONPATH="./Documents/pycharm-debug.egg:$PYTHONPATH"

这不起作用,现在我尝试了另一种方法,即附加.egg的位置的sys.path,但是也不起作用。

我究竟做错了什么?

提前致谢

编辑:忘了提及我在osx上

I'm working with PyCharm and set up a remote debugging with PyDev. Now everything is ready except when I want to debug it tells me this message in the PyCharm console:

Warning: wrong debugger version. Use pycharm-debugger.egg from PyCharm installation folder.

So I'm working in a virtualenv for Python so I logged on the the virtualenv and set the Python path to the .egg (I copied the .egg to my documents to make it easier).

PYTHONPATH="$PYTHONPATH:./Documents/pycharm-debug.egg"

Or

PYTHONPATH="./Documents/pycharm-debug.egg:$PYTHONPATH"

This didn't work, now I tried the other method which is to append the sys.path with the location of the .egg but that didn't work either.

What am I doing wrong?

Thanks in advance

EDIT: Forgot to mention I'm on osx

原文:https://stackoverflow.com/questions/27238687

更新时间:2019-12-09 01:38

最满意答案

编辑:好的抱歉,我误解了。

所以你需要添加一个环境变量的路径,抱歉。 我正在使用bash脚本,如下所示:

pythonenv.sh

#!/bin/bash

export PYTHONPATH="$PYTHONPATH:./Documents/pycharm-debug.egg"

然后像这样调用脚本:

源pythonenv.sh

此时你在shell中得到了env变量,请记住在关闭shell之后你会失去env变量。

所以我不知道OSX在你的用户文件夹中是否有初始化脚本,你应该把这行放在.rc文件中:

export PYTHONPATH="$PYTHONPATH:./Documents/pycharm-debug.egg"

因此,每次打开shell时,都会自动定义PYTHONPATH变量,这里有一些指导:

EDIT: Ok sorry about that, i misunderstood.

So you need to add the path to an environment variable, sorry. I was using a bash script for that, like this:

pythonenv.sh

#!/bin/bash

export PYTHONPATH="$PYTHONPATH:./Documents/pycharm-debug.egg"

then call the script like this:

source pythonenv.sh

At this point you got the env variable in your shell, remember that after you close your shell you lose the env variable.

So i don't know if OSX has an initialization script in your user folder, you should put this line in your .rc file:

export PYTHONPATH="$PYTHONPATH:./Documents/pycharm-debug.egg"

So everytime you open a shell you have automatically defined the PYTHONPATH variable, some guidance here:

2014-12-02

相关问答

从我的调查结果可以看出,一些鸡蛋被打包成zip文件,并被保存在Python的site-packages目录中。 这些压缩的蛋需要在执行之前解压缩,因此扩展到PYTHON_EGG_CACHE目录,默认情况下是~/.python-eggs (位于用户的主目录中)。 如果不存在,则在尝试运行应用程序时会导致问题。 有一些修复: 在用户的主目录中创建一个.python-eggs目录,并使其可写入用户。 创建一个解压缩的全局目录(例如/tmp/python-eggs ),并将环境变量PYTHON_EGG_C

...

系统中存在的东西是有原因的:因为它们被系统使用。 你不应该改变那里的东西,除非你知道你在做什么,即使这样,除非你有充分的理由。 库是您安装以供自己使用的软件的正确位置。 Things that are in System are there for a reason: because they're used by the system. You should not change things in there unless you know what you're doing, and eve

...

编辑:好的抱歉,我误解了。 所以你需要添加一个环境变量的路径,抱歉。 我正在使用bash脚本,如下所示: pythonenv.sh #!/bin/bash

export PYTHONPATH="$PYTHONPATH:./Documents/pycharm-debug.egg"

然后像这样调用脚本: 源pythonenv.sh 此时你在shell中得到了env变量,请记住在关闭shell之后你会失去env变量。 所以我不知道OSX在你的用户文件夹中是否有初始化脚本,你应该把这行放在.rc文件中

...

如果你想硬编码共享库的位置,你可以使用rpath选项。 为此,你会做一些像.. python setup.py build_ext --rpath=/usr/local/lib/python/site-packages/foo.egg/path/to

上面的setup.py是用于构建wrapped.cpython-36m-x86_64-linux-gnu.so的脚本,而rpath是libfoo.so的路径。当然,您应该能够直接将它放入构建脚本中,取决于该进程的外观。 -rpath = DIR 将

...

是的绝对,但更多的阅读这个http://www.ibm.com/developerworks/library/l-cppeak3.html转到从上述网站复制的“所有关于鸡蛋”部分: 然而,这种对PYTHONPATH(或脚本或Python shell会话中的sys.path)的操纵有点脆弱。 发现蛋可能是最好的一些新的魔法.pth文件中处理。 在site-packages /或PYTHONPATH中找到的任何.pth文件都会被解析,以便执行额外的导入操作,其方式与检查可能包含软件包的位置中的目录的方

...

在我的Mac上,我有一些.egg是文件,有些.egg是文件夹,例如我的SQLObject是一个文件夹,但我的oauth是一个文件。 我不确定为什么,这可能是因为我下载和安装它们的方式。 “添加zip / jar / egg”选择器无法选择文件夹,但简单的解决方案就是通过“添加源文件夹”来包含这些选项。 Perhaps this only on OS X, but simple solution was to just add the egg as a folder via New Folder.

...

...你可以在我左边指向zc.recipe.cmmi的评论中阅读源代码,你会在zc/recipe/cmmi/__init__.py中的Recipe类中注意到以下zc/recipe/cmmi/__init__.py class Recipe(object):

def __init__(self, buildout, name, options):

self.buildout, self.name, self.options = buildout, name, options

...

您只需要为该文件夹中的守护程序用户授予权限。 sudo chown -R daemon.daemon /opt/bitnami/.tmp

sudo chmod -R 700 /opt/bitnami/.tmp

此外,如果您使用的是已经使用mod_wsgi(0.12.2-1或更高版本)的BitNami Trac堆栈版本,则可以将PYTHON_EGG_CACHE配置为指向其他位置。 在trac.wsgi文件中,您只需添加: os.environ['PYTHON_EGG_CACHE'] = '/pat

...

我发现的第一件事是一个包必须是一个目录。 所以有必要保持这样的结构: my_project/

my_module/

__init__.py

output/

create_egg.py

test_egg.py

为了跳过指定命令行参数的必要性,有一个特殊选项script_args 。 我在这里找到它: http : //peak.telecommunity.com/DevCenter/setuptools 我的__init__.py : class MyCla

...

使用安装脚本创建一个zip文件。 将zip文件放在对象存储中。 使用http或curl从对象存储下载zip到bluemix笔记本环境。 请为zip文件安装pip。 Create a zip file with setup script. Put the zip file in object storage. Download zip using http or curl from object storage into bluemix notebook environment. Do pip in

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值