小编mac*_*nic的帖子

如何避免 conda activate base 在我的 VS Code 编辑器中自动执行?

PS E:\Python and Data Science\PythonDatabase> conda activate base
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling    
of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ conda activate base
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (conda:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS E:\Python and Data Science\PythonDatabase> & C:/Users/Lenovo/Anaconda3/python.exe "e:/Python and Data Science/PythonDatabase/CourseHelper.py" …
Run Code Online (Sandbox Code Playgroud)

python python-3.x conda visual-studio-code vscode-settings

5
推荐指数
1
解决办法
1830
查看次数

serial.serialutil.SerialException:无法打开端口 /dev/ttyAMA0:[Errno 13] 权限被拒绝:'/dev/ttyAMA0'

我有一个 Raspberry,我正在尝试连接到 Ubidots IOT 云,但出现以下错误:

pi@raspberrypi:~/Downloads/raspbiDaniela/Ver 2016/ZonrProject $ python main.py
    Traceback (most recent call last):
      File "main.py", line 124, in <module>
        main()
      File "main.py", line 21, in main
        ser = serial.Serial(port=port, baudrate=baud)
      File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
        self.open()
      File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
        raise SerialException("could not open port %s: %s" % (self._port, msg))
    serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'
Run Code Online (Sandbox Code Playgroud)

python serial-port pyserial raspberry-pi raspbian

3
推荐指数
1
解决办法
2万
查看次数

如何在virtualenv中强制安装软件包?

尝试在系统中安装具有不同版本的django,它向我显示:

Installing collected packages: Django
Found existing installation: Django 1.7.11
Not uninstalling django at /home/user/lib/python2.7, outside environment /home/user/webapps/v2_dev/venv
Run Code Online (Sandbox Code Playgroud)

成功安装Django-1.8.19

但实际上有旧版本

尝试了不同的命令:

./venv/bin/pip install Django==1.8.11

pip install Django==1.8.11
Run Code Online (Sandbox Code Playgroud)

更新:安装软件包时,它显示:

The required version of setuptools (>=16.0) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U setuptools'.
(Currently using setuptools 3.1 (/home/user/lib/python2.7/setuptools-3.1-py2.7.egg))
Run Code Online (Sandbox Code Playgroud)

升级时:

venv/bin/pip install --upgrade setuptools
Requirement already up-to-date: setuptools in ./venv/lib/python2.7/site-packages (40.5.0)
Run Code Online (Sandbox Code Playgroud)

python django pip webfaction

1
推荐指数
3
解决办法
2328
查看次数