简体   繁体   English

salesforce python Beatbox 导入错误

[英]salesforce python Beatbox import error

I am trying to log in to salesforce.com's sandbox using a URL, ID and PASS.我正在尝试使用 URL、ID 和 PASS 登录到 salesforce.com 的沙箱。 I want to use SOAP API for that.我想为此使用 SOAP API。 When I try to import beatbox in python3, it throws an ImportError exception.当我尝试在 python3 中导入 beatbox 时,它会抛出一个 ImportError 异常。 However, I can confirm that beatbox is installed in python3.但是,我可以确认beatbox安装在python3中。 So what am I doing wrong?那么我做错了什么? Is there any other way to do it?有没有其他方法可以做到?

Python 3.5.0 (default, Dec  6 2015, 17:23:12) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import beatbox
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/site-packages/beatbox-32.1-py3.5.egg/beatbox/__init__.py", line 1, in <module>
ImportError: No module named '_beatbox'
>>> 

The beatbox module that you probably installed is this : Beatbox 32.1 .您可能安装的 beatbox 模块是这样的: Beatbox 32.1

Solution 1 : The above beatbox module only supports python 2.x (tested with python 2.7).解决方案1:上面的beatbox模块只支持python 2.x(用python 2.7测试)。 So, switch to Python 2.x if that is an option.因此,如果可以选择,请切换到 Python 2.x。

You can find the source by original author of beatbox here and it has been updated to support python3.您可以在此处找到 beatbox 原作者的源代码,它已更新为支持 python3。

Solution 2 :解决方案2:

  • Clone the repo in your local machine using git clone https://github.com/superfell/Beatbox.git使用git clone https://github.com/superfell/Beatbox.git在本地机器上克隆 repo

  • Change to the Beatbox directory切换到 Beatbox 目录

  • Install the module using python setup.py install使用python setup.py install模块

For me the issue was I had both beatbox and beatbox3 installed.对我来说,问题是我同时安装了 beatbox 和 beatbox3。 beatbox3 is the version for python3. beatbox3 是python3 的版本。

Once I uninstalled beatbox it worked fine.一旦我卸载了beatbox,它就可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM