python虚拟环境 无法使用,无法为Python 3.4创建有效的虚拟环境

用户在Linux Mint 17.1上安装了Python 3.4.2和Virtualenv 12.0.5,并尝试创建虚拟环境时遇到权限拒绝错误。即使使用--clear和指定Python解释器路径也无法解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I installed Python 3.4.2 and Virtualenv 12.0.5 in my Linux Mint 17.1

Then I tried creating:

$ virtualenv venv

And also using --clear and/or -p /usr/bin/python3.4, always getting the messages:

Using base prefix '/usr'

New python executable in venv/bin/python3

Also creating executable in venv/bin/python

ERROR: The executable venv/bin/python3 could not be run: [Errno 13] Permission denied

Another try was:

$ pyvenv-3.4 venv

It gave no errors on creation, but in the venv/bin file the python3.4 is a symbolic link to /usr/local/bin/python3.4. Then when I activate and install any lib using pip or pip3, then try to import it, I get the error:

Traceback (most recent call last):

File "", line 1, in

ImportError: No module named 'anymoduledownloaded'

I always used virtualenv in Python 2.X and never got this kind of errors. Any thoughts on what am I doing wrong?

Thanks!!

=======EDITED=======

This is the output of my partitions (fdisk -l):

Device Boot Start End Blocks Id System

/dev/sda1 2048 98707455 49352704 83 Linux

/dev/sda2 303507456 3890644991 1793568768 5 Extended

/dev/sda3 * 98707456 303507455 102400000 7 HPFS/NTFS/exFAT

/dev/sda4 3890644992 3907028991 8192000 82 Linux swap / Solaris

/dev/sda5 303509504 3890644991 1793567744 7 HPFS/NTFS/exFAT`

And also my fstab:

-> was on /dev/sda1 during installation

UUID=a38f9c6d-3cd9-4486-b896-acbc6182ec61 / ext4 errors=remount-ro 0 1

-> swap was on /dev/sda4 during installation

UUID=efad7b53-79a8-4230-8226-9ca90c68ea9d none swap sw 0 0`

解决方案

Is that a shared partition that you have mounted? Does the shared partition have a different filesystem then the non-shared one you tried upon? If yes, then IMO, that will definitely cause an error since you are making and compiling binaries for python on one filesystem, and so it will not work on another filesystem.

As mentioned in this answer, adding to your /etc/fstab with an entry with exec flag might make it work for you, i.e., you might need to add another entry for the NTFS disk here to make it automount:

-> was on /dev/sdaX during installation

UUID= / ntfs auto,user,exec,nodev,rw,errors=remount-ro 0 1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值