简体   繁体   English

如何从USB运行python?

[英]How to run python from usb?

I am trying to download and run Python and PyCharm off of a usb stick because I am a newbie and suck with remembering all the OS specific setup, so the code I work on at work, does not work on my home computer.我正在尝试从 USB 记忆棒下载并运行 Python 和 PyCharm,因为我是一个新手并且很难记住所有操作系统特定的设置,所以我在工作中使用的代码在我的家用计算机上不起作用。

When I try to run python.exe from the usb drive, I get the error "Windows cannot access the specified device path or file you may not have appropriate permissions".当我尝试从 USB 驱动器运行 python.exe 时,出现错误“Windows 无法访问指定的设备路径或文件,您可能没有适当的权限”。 I am local admin and can open folders, just not run the exe.我是本地管理员,可以打开文件夹,只是不能运行 exe。

Any help would be greatly appreciated任何帮助将不胜感激

TL;DR I want a centralized place for all of my code to be neatly and easily stored, retrieved, edited, and tested. TL;DR 我想要一个集中的地方,我的所有代码都可以整齐、轻松地存储、检索、编辑和测试。

use python virtualenv使用 python virtualenv

pip install virtualenv
python -m virtualenv mypython

It will generate a 'new' python ( mypython ) that you may copy into your USB stick.它将生成一个“新”python ( mypython ),您可以将其复制到您的 U 盘中。

Read the documentation here .阅读此处的文档。

Try Portable Python .试试便携式 Python

Python virtualenv use your installed python that's why you can't share it using usb stick or add it on your github repository. Python virtualenv 使用您安装的 python,这就是为什么您不能使用 USB 棒共享它或将它添加到您的 github 存储库中的原因。

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

相关问题 如何制作可启动的USB以运行Python脚本 - How to make a bootable USB to run a Python script 如何从USB PenDrive运行AC代码? - how to run a c code from a usb pendrive? 如何在USB闪存驱动器插入上运行Python脚本 - How to run Python script on USB flash-drive insertion 如何在 Python 中运行 PowerShell cmdlet 以获取已连接 USB 设备的列表? - How to run a PowerShell cmdlet in Python to get a list of connected USB devices? 当 usb 插入 Linux 机器时,如何运行带有导入的 python 脚本? - How to run a python script with imports when usb plugged into Linux machine? 如何使用python检测多个USB端口并从USB读取数据 - how to detect multiple USB ports and read data from USB using python Linux 上的 Python:如何*立即*将文件移动到 USB 以避免操作系统不同步和 ZEDC9F0A5A5EC6184F7 突然拉出问题701CF39BD7328 - Python on Linux: How to *immediately* move files to USB to avoid issues from OS not syncing and the USB suddenly being pulled 插入USB时自动运行python文件 - Auto run python file when usb inserted 如何从Python中的USB设备VID和PID确定sysfs devpath? - How to determine sysfs devpath from USB device VID and PID in Python? 如何在 Python 中从 USB 连接的手机中读取文件? - How to read files from USB connected phone in Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM