termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
35.33k stars 3.71k forks source link

[Bug]: python virtualenv #4089

Closed user-11150 closed 1 month ago

user-11150 commented 1 month ago

Problem description

python virtualenv cannot create in external storage

Steps to reproduce the behavior.

Use virtualenv:

PermissionError: [Errno 1] Operation not permitted: '/data/data/com.termux/files/usr/bin/python3.11' -> '/storage/emulated/0/My_file/projects/puel/env/bin/python'

Use venv:

Error: [Errno 1] Operation not permitted: 'lib' -> '/storage/emulated/0/My_file/projects/puel/venv/lib64'

What is the expected behavior?

Successful to create virtualenv

System information

twaik commented 1 month ago

Do not try to put virtualenv or any executable code to sdcard. Sdcardfs has restrictions and does not allow executables or symlinks.

user-11150 commented 1 month ago

Use conda?

twaik commented 1 month ago

It does not matter what you use to create virtualenv. Do not use sdcard or shared storage for this.

user-11150 commented 1 month ago

Why I can run c extensions(like viztracer) in external storage

twaik commented 1 month ago

Scripts can be used. But not executables. I mean if you do something like python3 ./somescript.py it will run fine, but ./somescript.py will not work. And many python stuff uses the latter option.

user-11150 commented 1 month ago

Is /bin/xxx not external storage?

Why I can run like /bin/ls

twaik commented 1 month ago

/bin is a part of core OS.

user-11150 commented 1 month ago

Is external storage just /storage/emulated/0/ and SD cards?

twaik commented 1 month ago

You should not use anything under /storage and /mnt.

user-11150 commented 1 month ago

Do you have VM can run tsu?

twaik commented 1 month ago

Termux does not run in VMs properly. They do not have proper implementations for some subsystems required by Termux.

user-11150 commented 1 month ago

Is kali not a VM?

sylirre commented 1 month ago

/storage/emulated/0, external SD cards and whatever else except private internal storage (/data/data/com.termux) doesn't support execution and special files such as symbolic links.

Read https://wiki.termux.com/wiki/Internal_and_external_storage

Please setup your stuff in Termux home directory. Many code editors can access it without root permissions. QuickEdit app is an example of such editors.


Do not report issues about stuff beyond the control of Termux, like behavior of Android OS and file system limited features.

sylirre commented 1 month ago

Is kali not a VM?

No, it is not a VM but is a distribution that is not related to Termux in any way.