Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pipenv shell or other pip commands shows AttributeError: 'AnsiToWin32' object has no attribute 'fileno' #5560

Closed
rahulmukh1ya opened this issue Jan 2, 2023 · 14 comments
Labels
Status: Needs More Information This issue does not provide enough information to take further action. Windows

Comments

@rahulmukh1ya
Copy link

I recently got into python and django and decided to use pipenv for virtual environments, it installed just fine.
But when using pipenv shell or other pipenv commands like pipenv install requests. I always get the following error (on Windows cmd/powershell)

pipenv shell shows the error below.

Creating a virtualenv for this project...
Pipfile: C:\Users\samue\Desktop\helloWorld\Pipfile
Using C:/Users/samue/AppData/Local/Programs/Python/Python310/python.exe (3.10.9) to create virtualenv...
created virtual environment CPython3.10.9.final.0-64 in 687ms
  creator CPython3Windows(dest=C:\Users\samue\.virtualenvs\helloWorld-OnoJB8yo, clear=False, no_vcs_ignore=False, global
=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\samue\
AppData\Local\pypa\virtualenv)
    added seed packages: pip==22.3.1, setuptools==65.6.3, wheel==0.38.4
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

Traceback (most recent call last):
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\core.py", line 1041, in do_creat
e_virtualenv
    err.print(
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\console
.py", line 1646, in print
    with self:
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\console
.py", line 848, in __exit__
    self._exit_buffer()
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\console
.py", line 806, in _exit_buffer
    self._check_buffer()
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\console
.py", line 1990, in _check_buffer
    self.file.fileno() in _STD_STREAMS_OUTPUT
AttributeError: 'AnsiToWin32' object has no attribute 'fileno'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\Scripts\pipenv.exe\__main__.py", line 7, in <module>
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\vendor\click\core.py", line 1128
, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\cli\options.py", line 57, in mai
n
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\vendor\click\core.py", line 1053
, in main
    rv = self.invoke(ctx)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\vendor\click\core.py", line 1659
, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\vendor\click\core.py", line 1395
, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\vendor\click\core.py", line 754,
 in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\vendor\click\decorators.py", lin
e 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\vendor\click\core.py", line 754,
 in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\cli\command.py", line 402, in sh
ell
    do_shell(
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\core.py", line 2641, in do_shell

    ensure_project(
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\core.py", line 541, in ensure_pr
oject
    ensure_virtualenv(
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\core.py", line 474, in ensure_vi
rtualenv
    do_create_virtualenv(
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\core.py", line 1025, in do_creat
e_virtualenv
    with console.status(
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\status.
py", line 106, in __exit__
    self.stop()
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\status.
py", line 91, in stop
    self._live.stop()
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\live.py
", line 147, in stop
    with self.console:
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\console
.py", line 848, in __exit__
    self._exit_buffer()
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\console
.py", line 806, in _exit_buffer
    self._check_buffer()
  File "C:\Users\samue\AppData\Local\Programs\Python\Python310\lib\site-packages\pipenv\patched\pip\_vendor\rich\console
.py", line 1990, in _check_buffer
    self.file.fileno() in _STD_STREAMS_OUTPUT
AttributeError: 'AnsiToWin32' object has no attribute 'fileno'

Running $ pipenv --support, gave the following output:

$ pipenv --support

Pipenv version: '2022.12.19'

Pipenv location: 'C:\\Users\\samue\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\pipenv'

Python location: 'C:\\Users\\samue\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'

OS Name: 'nt'

User pip version: '22.3.1'

user Python installations found:

  • 3.10.9: C:\Users\samue\AppData\Local\Programs\Python\Python310\python.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.9',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.19044',
 'python_full_version': '3.10.9',
 'python_version': '3.10',
 'sys_platform': 'win32'}

System environment variables:

  • ALLUSERSPROFILE
  • APPDATA
  • COMMONPROGRAMFILES
  • COMMONPROGRAMFILES(X86)
  • COMMONPROGRAMW6432
  • COMPUTERNAME
  • COMSPEC
  • DRIVERDATA
  • FPS_BROWSER_APP_PROFILE_STRING
  • FPS_BROWSER_USER_PROFILE_STRING
  • HOMEDRIVE
  • HOMEPATH
  • LOCALAPPDATA
  • LOGONSERVER
  • NUMBER_OF_PROCESSORS
  • ONEDRIVE
  • ONEDRIVECONSUMER
  • OS
  • PATH
  • PATHEXT
  • PROCESSOR_ARCHITECTURE
  • PROCESSOR_IDENTIFIER
  • PROCESSOR_LEVEL
  • PROCESSOR_REVISION
  • PROGRAMDATA
  • PROGRAMFILES
  • PROGRAMFILES(X86)
  • PROGRAMW6432
  • PSMODULEPATH
  • PUBLIC
  • SESSIONNAME
  • SYNAPROGDIR
  • SYSTEMDRIVE
  • SYSTEMROOT
  • TEMP
  • TMP
  • USERDOMAIN
  • USERDOMAIN_ROAMINGPROFILE
  • USERNAME
  • USERPROFILE
  • WINDIR
  • ZES_ENABLE_SYSMAN
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_PYTHON_PATH
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv?specific environment variables:

Debug?specific environment variables:

  • PATH: C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk-19\bin;C:\Users\samue\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\samue\AppData\Local\Programs\Python\Python310\;C:\Users\samue\AppData\Local\Microsoft\WindowsApps;C:\src\flutter\bin;C:\Users\samue\AppData\Local\Programs\Microsoft VS Code\bin;C:\src\flutter\bin\cache\dart-sdk\bin

PS: I tried this on python 3.11.1 and had the same issue.

@oz123
Copy link
Contributor

oz123 commented Jan 3, 2023

This is related to rich transition. Are you using Python 32bit or 64bit?
How are you installing Python?

@oz123 oz123 added the Windows label Jan 3, 2023
@rahulmukh1ya
Copy link
Author

@oz123 I am using python 64 bit and i downloaded python from python.org and ran the .exe

@josejfg
Copy link

josejfg commented Jan 3, 2023

It´s a bug, Version 2022.11.30 work fine
use pip install pipenv==2022.11.30

@oz123
Copy link
Contributor

oz123 commented Jan 3, 2023

I can't reproduce it. Let's try and find why my system is working and yours isn't:
Here is my complete log, after a fresh install of Python 64bit from python.org.
I am using the dump windows cmd terminal. Are you using something else?


C:\Users\Dell>pip install pipenv
Collecting pipenv
  Downloading pipenv-2022.12.19-py3-none-any.whl (2.9 MB)
     ---------------------------------------- 2.9/2.9 MB 4.9 MB/s eta 0:00:00
Collecting certifi
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ---------------------------------------- 155.3/155.3 kB 9.7 MB/s eta 0:00:00
Requirement already satisfied: setuptools>=36.2.1 in c:\users\dell\appdata\local\programs\python\python311\lib\site-packages (from pipenv) (65.5.0)
Collecting virtualenv-clone>=0.2.5
  Downloading virtualenv_clone-0.5.7-py3-none-any.whl (6.6 kB)
Collecting virtualenv
  Downloading virtualenv-20.17.1-py3-none-any.whl (8.8 MB)
     ---------------------------------------- 8.8/8.8 MB 5.2 MB/s eta 0:00:00
Collecting distlib<1,>=0.3.6
  Downloading distlib-0.3.6-py2.py3-none-any.whl (468 kB)
     ---------------------------------------- 468.5/468.5 kB 4.2 MB/s eta 0:00:00
Collecting filelock<4,>=3.4.1
  Downloading filelock-3.9.0-py3-none-any.whl (9.7 kB)
Collecting platformdirs<3,>=2.4
  Downloading platformdirs-2.6.2-py3-none-any.whl (14 kB)
Installing collected packages: distlib, virtualenv-clone, platformdirs, filelock, certifi, virtualenv, pipenv
Successfully installed certifi-2022.12.7 distlib-0.3.6 filelock-3.9.0 pipenv-2022.12.19 platformdirs-2.6.2 virtualenv-20.17.1 virtualenv-clone-0.5.7

C:\Users\Dell>mkdir foo

C:\Users\Dell>cd foo

C:\Users\Dell\foo>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Dell\foo>pipenv shell
Creating a virtualenv for this project...
Pipfile: C:\Users\Dell\foo\Pipfile
Using C:/Users/Dell/AppData/Local/Programs/Python/Python311/python.exe (3.11.1) to create virtualenv...
[  ==] Creating virtual environment...created virtual environment CPython3.11.1.final.0-64 in 4140ms
  creator CPython3Windows(dest=C:\Users\Dell\.virtualenvs\foo-XGZ0n-9n, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\Dell\AppData\Local\pypa\virtualenv)
    added seed packages: pip==22.3.1, setuptools==65.6.3, wheel==0.38.4
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

Successfully created virtual environment!
Virtualenv location: C:\Users\Dell\.virtualenvs\foo-XGZ0n-9n
Creating a Pipfile for this project...
Launching subshell in virtual environment...
Microsoft Windows [Version 10.0.19045.2364]
(c) Microsoft Corporation. All rights reserved.

(foo-XGZ0n-9n) C:\Users\Dell\foo>pipenv install o3
Installing o3...
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Locking [dev-packages] dependencies...
Updated Pipfile.lock (c122bcd07f84e9dfc135eaca44e7f6450f4711dc87dfa26b794a72467ed077fa)!
Installing dependencies from Pipfile.lock (d077fa)...

(foo-XGZ0n-9n) C:\Users\Dell\foo>

My support output:
pipenv --support

Pipenv version: '2022.12.19'

Pipenv location: 'C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pipenv'

Python location: 'C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python311\\python.exe'

OS Name: 'nt'

User pip version: '22.3.1'

user Python installations found:

  • 3.11.1: C:\Users\Dell\AppData\Local\Programs\Python\Python311\python.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.11.1',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.19045',
 'python_full_version': '3.11.1',
 'python_version': '3.11',
 'sys_platform': 'win32'}

System environment variables:

  • ALLUSERSPROFILE
  • APPDATA
  • COMMONPROGRAMFILES
  • COMMONPROGRAMFILES(X86)
  • COMMONPROGRAMW6432
  • COMPUTERNAME
  • COMSPEC
  • DRIVERDATA
  • HOMEDRIVE
  • HOMEPATH
  • LOCALAPPDATA
  • LOGONSERVER
  • NUMBER_OF_PROCESSORS
  • ONEDRIVE
  • OS
  • PATH
  • PATHEXT
  • PIPENV_ACTIVE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_PYTHON_PATH
  • PROCESSOR_ARCHITECTURE
  • PROCESSOR_IDENTIFIER
  • PROCESSOR_LEVEL
  • PROCESSOR_REVISION
  • PROGRAMDATA
  • PROGRAMFILES
  • PROGRAMFILES(X86)
  • PROGRAMW6432
  • PROMPT
  • PSMODULEPATH
  • PUBLIC
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED
  • SESSIONNAME
  • SYSTEMDRIVE
  • SYSTEMROOT
  • TEMP
  • TMP
  • USERDOMAIN
  • USERDOMAIN_ROAMINGPROFILE
  • USERNAME
  • USERPROFILE
  • VIRTUAL_ENV
  • WINDIR

Pipenv–specific environment variables:

  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: C:\Users\Dell\.virtualenvs\foo-XGZ0n-9n\Scripts;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Users\Dell\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\Dell\AppData\Local\Programs\Python\Python311\;C:\Users\Dell\AppData\Local\Microsoft\WindowsApps;;C:\Users\Dell\AppData\Local\Programs\Microsoft VS Code\bin
  • VIRTUAL_ENV: C:\Users\Dell\.virtualenvs\foo-XGZ0n-9n

Contents of Pipfile ('C:\Users\Dell\foo\Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
o3 = "*"

[dev-packages]

[requires]
python_version = "3.11"

@rahulmukh1ya
Copy link
Author

It´s a bug, Version 2022.11.30 work fine use pip install pipenv==2022.11.30

@josejfg Thanks alot, this version seems to work fine.

@oz123 oz123 added the Status: Needs More Information This issue does not provide enough information to take further action. label Jan 3, 2023
@matteius
Copy link
Member

It's possible this is a windows regression when we switched to the rich console ... Can anyone re-check this with pipenv==2023.2.18?

@BrianZ111
Copy link

BrianZ111 commented Feb 20, 2023

This probably won’t make any sense as far as a cause for the problem but a few days ago I upgraded from a really old version of pipenv (probably over a year old) to the latest (not sure if it was 2023.2.4 or 2023.2.18 as I don't remember exactly what day it was). It was working fine. I had it installed as --user at the time. I always keep my system installs clean. I have python 3.8.12 and python 3.7.12 installed with python 3.8.12 being the one on PATH and where pipenv was installed.

Yesterday I was looking at pipx for installing some other packages and I decided change my pipenv install to using pipx. I did so by deleting the Python38 user folder (not sure if I should have uninstalled pipenv first? but I didn't), installing pipx as --user to recreate it, and finally installing pipenv using pipx. Now I am getting this error. However when I uninstall pipenv with pipx and reinstall pipenv as --user I still get this error (tried installing both 2023.2.4 and 2023.2.18, same error result). So maybe it has nothing to do with it. It’s possible I did something else to my system while I was playing around with pipx but I don’t know what it would have been.

Just wanted to share in case it was helpful. Like others have mentioned, 2022.11.30 works fine (installed as user and installed with pipx) so I will just continue to use that version for now and hope this gets solved in some future version.

@matteius
Copy link
Member

@BrianZ111 I would not expect this to get solved in a future version as we plan to convert more of the click.echo/click.secho code to use the rich console, which is where this error is originating. I never understood the guidance in our docs about pipx, and I think at this point I'd like to remove that recommendation to use pipx for anything pipenv related. It definitely sounds like you are getting some cross package import issues between two different versions of pipenv. For me, it works fine on Windows.

@matteius matteius closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2023
@snooppr
Copy link

snooppr commented Mar 3, 2023

pipenv, version 2023.2.18
I also got this error on two different Windows 7 32/64bit OS. There were old versions of pipenv and everything worked. Obviously, in the latest versions of pipenv, the package is broken. It helped me, installing pipenv of this version pipenv 2022.11.30

Traceback (most recent call last)
  File "c:\python38\lib\site-packages\pipenv\core.py", line 1002, in do_create_v
irtualenv
    err.print(
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\console.py
", line 1715, in print
    self._buffer.extend(new_segments)
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\console.py
", line 869, in __exit__
    self._exit_buffer()
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\console.py
", line 827, in _exit_buffer
    self._check_buffer()
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\console.py
", line 2011, in _check_buffer
    self.file.fileno() in _STD_STREAMS_OUTPUT
AttributeError: 'AnsiToWin32' object has no attribute 'fileno'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python38\Scripts\pipenv.exe\__main__.py", line 7, in <module>
  File "c:\python38\lib\site-packages\pipenv\vendor\click\core.py", line 1128, i
n __call__
    return self.main(*args, **kwargs)
  File "c:\python38\lib\site-packages\pipenv\cli\options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "c:\python38\lib\site-packages\pipenv\vendor\click\core.py", line 1053, i
n main
    rv = self.invoke(ctx)
  File "c:\python38\lib\site-packages\pipenv\vendor\click\core.py", line 1659, i
n invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python38\lib\site-packages\pipenv\vendor\click\core.py", line 1395, i
n invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python38\lib\site-packages\pipenv\vendor\click\core.py", line 754, in
 invoke
    return __callback(*args, **kwargs)
  File "c:\python38\lib\site-packages\pipenv\vendor\click\decorators.py", line 8
4, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\python38\lib\site-packages\pipenv\vendor\click\core.py", line 754, in
 invoke
    return __callback(*args, **kwargs)
  File "c:\python38\lib\site-packages\pipenv\cli\command.py", line 397, in shell

    do_shell(
  File "c:\python38\lib\site-packages\pipenv\core.py", line 2572, in do_shell
    ensure_project(
  File "c:\python38\lib\site-packages\pipenv\core.py", line 528, in ensure_proje
ct
    ensure_virtualenv(
  File "c:\python38\lib\site-packages\pipenv\core.py", line 465, in ensure_virtu
alenv
    do_create_virtualenv(
  File "c:\python38\lib\site-packages\pipenv\core.py", line 1002, in do_create_v
irtualenv
    err.print(
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\status.py"
, line 106, in __exit__
    self.stop()
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\status.py"
, line 91, in stop
    self._live.stop()
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\live.py",
line 163, in stop
    self.ipy_widget.close()  # pragma: no cover
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\console.py
", line 869, in __exit__
    self._exit_buffer()
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\console.py
", line 827, in _exit_buffer
    self._check_buffer()
  File "c:\python38\lib\site-packages\pipenv\patched\pip\_vendor\rich\console.py
", line 2011, in _check_buffer
    self.file.fileno() in _STD_STREAMS_OUTPUT
AttributeError: 'AnsiToWin32' object has no attribute 'fileno'

@matteius
Copy link
Member

matteius commented Mar 3, 2023

@snooppr its not obviously broken -- for one Windows 7 is EOL so I won't be able to help support that OS but on Windows 11 its working fine for me, so not obvious:

matte@LAPTOP-N5VSGIBD MINGW64 ~/Projects/pipenv (doc-revisions1)
$ pipenv shell
Loading .env environment variables...
Loading .env environment variables...
Launching subshell in virtual environment...

matte@LAPTOP-N5VSGIBD MINGW64 ~/Projects/pipenv (doc-revisions1)
$ pipenv --version
pipenv, version 2023.2.19.dev0

@oz123
Copy link
Contributor

oz123 commented Mar 3, 2023

I think this is really an issue caused by some weird behavior of the windows terminal in older versions which aren't compatible with rich.
Obviously rich isn't developed for windows 7 for the reason it's deprecated.

@snooppr
Copy link

snooppr commented Mar 4, 2023

I think this is really an issue caused by some weird behavior of the windows terminal in older versions which aren't compatible with rich. Obviously rich isn't developed for windows 7 for the reason it's deprecated.

Rich supports old windows terminals, I actively and successfully use rich v13.0.1 on Windows 7. When rich broke something in my project, I usually opened issues in rich and fixed it there.

@oz123
Copy link
Contributor

oz123 commented Mar 4, 2023

Well, in that case, you can open an issue with rich. It's been said already we can't support windows 7 with our limited resources.
If it's a company wide issue which affects multiple users, we night be able to find a solution.

@ezynsegnane
Copy link

ezynsegnane commented Apr 12, 2023

the following steps helped me to solve this problem :
#1
pip uninstall pipenv
#2
pip install pipenv==2022.11.30
#3
python -m pip install --upgrade pipenv
#4
pipenv shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs More Information This issue does not provide enough information to take further action. Windows
Projects
None yet
Development

No branches or pull requests

7 participants