我需要帮助理解在我的MacOS 10.12上的Python版本的组织。我有pip和brew,没有conda。在我使用Python3.6.5之前,brew更新并安装了Python3.7.0。
然后,我在尝试创建一个新的虚拟环境时遇到了以下问题:
$ virtualenv venv_pointnet
-bash: /usr/local/bin/virtualenv: /usr/local/opt/python3/bin/python3.6: bad interpreter: No such file or directory
所以我将这一行添加到我的~/.bash_profile中
alias p
当我完成安装python3时,我可以使用python2和python3命令,但是当我尝试python时,它说命令没有找到,下面是一些输出
[root@localhost bin]# python2
Python 2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&
我在~/localpython/python276中创建了一个本地python安装。在创建了一个virtualenv作为py276之后,我将idle链接到了~/localpython/python276 /bin/idle。我还激活了py276。
$ which python
/home/xxx/virtualenvs/py276/bin/python
$ python
Python 2.7.6
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license&
下面是供您参考的终端日志
Traceback (most recent call last):
File "src/Utilities_test/test_cases_csv.py", line 39, in <module>
report_status = email_reporter(html_report_dir.split('/', 1)[-1])
File "src/Utilities_support/report_email.py", line 27, in email_reporter for item
我正在试着把Python代码写成PHP。但我无法将PHP打包格式等同于Python打包格式
Python:
format = "!LLLLQ"
mystr = struct.unpack(format, str)
我是这样使用的
$mystr = unpack("!LLLLQ", $str); // But its not working
因为根本就没有!或PHP包中的Q。
有什么办法可以做到这一点吗?
Python的格式代码:
PHP格式代码:
谢谢!
我下载了Chromedriver并把它移到/usr/bin/python3中,它一直在我的终端上运行和失败,我无法想出如何从python3中删除它,我的文件管理人员说它是一个共享库。
所以我在/usr/bin/python3上做了一个D2,它去掉了显色剂。但现在我无法启动应用程序,如棒棒糖和鲶鱼。
现在,当我尝试运行它们时,会出现一个错误:
bash: /usr/bin/lollypop: /usr/bin/python3: bad interpreter: No such file or directory
我不知道如何重新安装python3。我试过:
sudo aptitude insta
我正在尝试将python 3.6设置为默认设置(而不是python 3.8)
:update-alternatives --list python的输出:
/usr/bin/python3.6
/usr/bin/python3.8
update-alternatives --config python的输出
There are 2 choices for the alternative python (providing /usr/bin/python).
Selection Path Priority Status
--------------
我在windows10的virtual box中运行ubuntu 18.04.1,Ubuntu运行的是2.7版本的python。U盘安装在路径/opt/ext_usb/yyyy上。当我尝试执行命令virtualenv my-env-name --no-site-packages时,我得到了以下错误。
Running virtualenv with interpreter /usr/bin/python2
New python executable in /opt/ext_usb/jpr_lamp/bin/python2
Also creating executable in /opt/ext_