1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] ImportError: cannot import name 'text_encoding' from 'io' (unknown location)

Discussão em 'Python' iniciado por Stack, Abril 10, 2025.

  1. Stack

    Stack Membro Participativo

    I've been trying to open up a virtual environment. I can open scrapy from anaconda powershell prompt, but I can't use it in the virtual environment. I have created the environment by using the command:

    C:\Python310\Scripts\virtualenv.exe C:\ProgramData\Anaconda3


    I have also started the virtual environment using the command:

    C:\ProgramData\Anaconda3\Scripts\activate.bat


    But I when I try using this command,

    scrapy shell


    it gives this error:

    Fatal Python error: init_sys_streams: can't initialize sys standard streams
    Python runtime state: core initialized
    Traceback (most recent call last):
    File "C:\Python310\lib\io.py", line 54, in <module>
    ImportError: cannot import name 'text_encoding' from 'io' (unknown location)


    I installed the virtual environment module with this command:

    pip install virtualenv


    But there are nothing like "activate.bat" in my scripts folder (C:\Python310\Scripts) instead there is the file "virtualenv.exe". However there is a scripts folder in my virtual environment (C:\ProgramData\Anaconda3\Scripts) which has the file "activate.bat".

    How can I fix the error? Am I doing something wrong? Thank you.

    Continue reading...

Compartilhe esta Página