<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>32211</bug_id>
          
          <creation_ts>2016-06-22 15:48:04 +0300</creation_ts>
          <short_desc>pyvenv in python3 fails</short_desc>
          <delta_ts>2019-04-18 18:54:13 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>python3</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>32205</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Grigory Ustinov">grenka</assigned_to>
          <cc>evg</cc>
    
    <cc>george</cc>
    
    <cc>glebfm</cc>
    
    <cc>grenka</cc>
    
    <cc>imz</cc>
    
    <cc>kotopesutility</cc>
    
    <cc>nbr</cc>
    
    <cc>obirvalger</cc>
    
    <cc>vitty</cc>
    
    <cc>vladimir.didenko</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>157419</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2016-06-22 15:48:04 +0300</bug_when>
    <thetext>python3-3.5.1-alt7

https://bugzilla.altlinux.org/show_bug.cgi?id=32205#c2 :

pyvenv тоже не рабочий.

$ pyvenv-3.5 .
Error: Command &apos;[&apos;/home/cow/test/python/bin/python3.5&apos;, &apos;-Im&apos;, &apos;ensurepip&apos;,
&apos;--upgrade&apos;, &apos;--default-pip&apos;]&apos; returned non-zero exit status 1
[cow@localhost python]$ /home/cow/test/python/bin/python3.5 -Im ensurepip
--upgrade --default-pip
Traceback (most recent call last):
  File &quot;/usr/lib64/python3.5/runpy.py&quot;, line 170, in _run_module_as_main
    &quot;__main__&quot;, mod_spec)
  File &quot;/usr/lib64/python3.5/runpy.py&quot;, line 85, in _run_code
    exec(code, run_globals)
  File &quot;/usr/lib64/python3.5/ensurepip/__main__.py&quot;, line 4, in &lt;module&gt;
    ensurepip._main()
  File &quot;/usr/lib64/python3.5/ensurepip/__init__.py&quot;, line 209, in _main
    default_pip=args.default_pip,
  File &quot;/usr/lib64/python3.5/ensurepip/__init__.py&quot;, line 98, in bootstrap
    &quot;_bundled/{}&quot;.format(wheel_name),
  File &quot;/usr/lib64/python3.5/pkgutil.py&quot;, line 629, in get_data
    return loader.get_data(resource_name)
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 815, in get_data
FileNotFoundError: [Errno 2] No such file or directory:
&apos;/usr/lib64/python3.5/ensurepip/_bundled/setuptools-18.2-py2.py3-none-any.whl&apos;

+++ This bug was initially created as a clone of Bug #32205 +++

1. Установлен starterkit с LXDE на борту. Для справки:
$ uname -r
4.4.13-std-def-alt0.M80P.1

$ cat /etc/redhat-release 
ALT Linux starter kit (Hypericum)

$ rpm -qa | grep python3-module-virtualenv
python3-module-virtualenv-13.1.0-alt1.1

2. Создаю виртуальное окружение:
$ virtualenv3 myvenv
Using base prefix &apos;/usr&apos;
New python executable in myvenv/bin/python3
Also creating executable in myvenv/bin/python
Installing setuptools, pip, wheel...done.

3. Активирую его:
$ source myvenv/bin/activate
(myvenv)[sadmin@comp-celeron-cpu-919525 ~]$ 

4. Обновляю pip:
$ pip install --upgrade pip
Traceback (most recent call last):
  File &quot;/home/sadmin/myvenv/bin/pip&quot;, line 7, in &lt;module&gt;
    from pip import main
ImportError: No module named &apos;pip&apos;

5. Устанавливаю произвольный пакет:
$ pip install mutagen==1.29
Traceback (most recent call last):
  File &quot;/home/sadmin/myvenv/bin/pip&quot;, line 7, in &lt;module&gt;
    from pip import main
ImportError: No module named &apos;pip&apos;

И в качестве дополнения. В p8 третий Питон имеет версию 3.5.1, а это предполагает наличие стандартного модуля для создания виртуального окружения и работы с ним. Так вот этот модуль отпинывает попытки создать виртуальное окружение:

$ python3 -m venv myvenv2
Error: Command &apos;[&apos;/home/sadmin/myvenv2/bin/python3&apos;, &apos;-Im&apos;, &apos;ensurepip&apos;, &apos;--upgrade&apos;, &apos;--default-pip&apos;]&apos; returned non-zero exit status 1

Буду признателен и благодарен за решение проблемы. Если вдруг я где-то заблудился и чего-то не так делаю, прошу строго не судить.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>158371</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2016-08-31 18:19:17 +0300</bug_when>
    <thetext>site-packages re-configuration example -- so that new site-packages are seen by the old python3:

http://git.altlinux.org/gears/p/python3.0.git?p=python3.0.git;a=blob;f=python3.spec;h=0df8a1d9dda6e43699ef5dd3881244ea055a8401;hb=3802a4828d5b863cf2ff2d60b5a639e720e705da#l77</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>158372</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2016-08-31 19:10:24 +0300</bug_when>
    <thetext>Про venv :

при сборке пакета python3 таких лишних неупакованных файлов нет:

warning: Installed (but unpackaged) file(s) found:
    /usr/lib64/libpython3.5m.a

в репозитории пакетов, это содержащих, нет:


[imz@basalt ~]$ fgrep /ensurepip /ALT/Sisyphus/*/base/contents_index 
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/__init__.py	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/__init__.pyc	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/__init__.pyo	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/__main__.py	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/__main__.pyc	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/__main__.pyo	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/_uninstall.py	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/_uninstall.pyc	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python2.7/ensurepip/_uninstall.pyo	python-modules-ensurepip
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__init__.py	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__main__.py	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/__init__.cpython-35.opt-1.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/__init__.cpython-35.opt-2.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/__init__.cpython-35.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/__main__.cpython-35.opt-1.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/__main__.cpython-35.opt-2.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/__main__.cpython-35.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/_uninstall.cpython-35.opt-1.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/_uninstall.cpython-35.opt-2.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/__pycache__/_uninstall.cpython-35.pyc	python3-base
/ALT/Sisyphus/i586/base/contents_index:/usr/lib/python3.5/ensurepip/_uninstall.py	python3-base
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/doc/python-doc-2.7.12/_sources/library/ensurepip.txt	python-doc
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/doc/python-doc-2.7.12/library/ensurepip.html	python-doc
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/doc/python3-doc-3.5.2/_sources/library/ensurepip.txt	python3-doc
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/doc/python3-doc-3.5.2/library/ensurepip.html	python3-doc
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/__init__$py.class	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/__init__.py	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/__main__$py.class	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/__main__.py	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_bundled	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_bundled/pip-1.6-py2.py3-none-any.whl	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_bundled/setuptools-14.3.2-py2.py3-none-any.whl	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_uninstall$py.class	jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_uninstall.py	jython
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/__init__.py	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/__init__.pyc	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/__init__.pyo	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/__main__.py	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/__main__.pyc	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/__main__.pyo	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/_uninstall.py	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/_uninstall.pyc	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python2.7/ensurepip/_uninstall.pyo	python-modules-ensurepip
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__init__.py	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__main__.py	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/__init__.cpython-35.opt-1.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/__init__.cpython-35.opt-2.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/__init__.cpython-35.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/__main__.cpython-35.opt-1.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/__main__.cpython-35.opt-2.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/__main__.cpython-35.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/_uninstall.cpython-35.opt-1.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/_uninstall.cpython-35.opt-2.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/__pycache__/_uninstall.cpython-35.pyc	python3-base
/ALT/Sisyphus/x86_64/base/contents_index:/usr/lib64/python3.5/ensurepip/_uninstall.py	python3-base
[imz@basalt ~]$ 

Зато это есть у jython.

Откуда это надо брать? Какие идеи? Помощь в правильной упаковке приветствуется.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>158373</commentid>
    <comment_count>3</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2016-08-31 19:14:39 +0300</bug_when>
    <thetext>имею в виду


/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_bundled
   jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_bundled/pip-1.6-py2.py3-none-any.whl
   jython
/ALT/Sisyphus/noarch/base/contents_index:/usr/share/jython/Lib/ensurepip/_bundled/setuptools-14.3.2-py2.py3-none-any.whl
   jython

Терятеся при сборке python3? Или стоит по-другому &quot;настроить&quot; venv при упаковке так, чтобы оно это в другом виде искало?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166669</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2017-10-28 04:46:14 +0300</bug_when>
    <thetext>Я-то тут причём?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>170155</commentid>
    <comment_count>5</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2018-04-02 17:44:02 +0300</bug_when>
    <thetext>В Debian создают wheels (необходимые для работы venv) при сборке пакетов, по-моему:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732703#55

Bug #748301 is the distlib patch to build its wheel.

Bug #748299 is the python-setuptools patch to build its wheel.

и см. также остальные их переделки.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>180964</commentid>
    <comment_count>6</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2019-04-18 18:54:13 +0300</bug_when>
    <thetext>python3-3.7.3-alt1 -&gt; sisyphus:

Tue Apr 02 2019 Grigory Ustinov &lt;grenka@altlinux&gt; 3.7.3-alt1
- Updated to upstream version 3.7.3 (Closes: #36297).
- Added list of architectures which has multilib support in ALT (thx to arei@).
- Added pathfix.py to python3-tools (thx to viy@).
- Bring back venv support (thx to obirvalger@ and imz@) (Closes: #32211).
- Add idle desktop file (Closes: #27542.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>