Skip to content

LookupError: unknown encoding: future_fstrings #12

Open

Description

@AlixAbbasi

I get the following error when I am trying to install it:

`
ubuntu@ubuntu:~/heap$ sudo pip3 install ./libptmalloc/
Processing ./libptmalloc
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3.10/tokenize.py", line 344, in find_cookie
          codec = lookup(encoding)
      LookupError: unknown encoding: future_fstrings
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 28, in <module>
        File "/usr/lib/python3.10/tokenize.py", line 396, in open
          encoding, lines = detect_encoding(buffer.readline)
        File "/usr/lib/python3.10/tokenize.py", line 373, in detect_encoding
          encoding = find_cookie(first)
        File "/usr/lib/python3.10/tokenize.py", line 352, in find_cookie
          raise SyntaxError(msg)
      SyntaxError: unknown encoding for '/home/ubuntu/heap/libptmalloc/setup.py': future_fstrings
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
ubuntu@ubuntu:~/heap$ python3 --version
Python 3.10.6

`

Installing or uninstalling future_fstrings package does not seem like affecting the outcome.

Activity

  1. saidelike commented on Nov 8, 2022

    @saidelike
    Collaborator

    Hi,

    Thanks for your report.

    It is weird that it complains about fstrings missing since you use Python 3.10 which should have native support for f-strings.

    You could always try to install future_fstrings as detailed in https://github.com/nccgroup/libptmalloc/blob/master/docs/InstallGuide.md#libptmalloc-installation to see if that fixes the problem?

    Another idea would be to try the following instead to see if you still have the error?

    cd libptmalloc
    sudo python3 setup.py install
    

    On a final note, you should be able to use libptmalloc even without installing it as detailed in https://github.com/nccgroup/libptmalloc/blob/master/docs/InstallGuide.md#use-without-installation

  2. AlixAbbasi commented on Nov 9, 2022

    @AlixAbbasi
    Author

    Thank you for the reply. It is indeed weird. I tried to follow your recommendation but I got the same result.

    ubuntu@ubuntu:~/heap$ pip3 install -r libptmalloc/requirements.txt
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: hexdump==3.3 in /home/ubuntu/.local/lib/python3.10/site-packages (from -r libptmalloc/requirements.txt (line 1)) (3.3)
    Requirement already satisfied: future-fstrings==1.2.0 in /home/ubuntu/.local/lib/python3.10/site-packages (from -r libptmalloc/requirements.txt (line 3)) (1.2.0)
    
    ubuntu@ubuntu:~/heap$ cd libptmalloc/
    
    ubuntu@ubuntu:~/heap/libptmalloc$ sudo python3 setup.py install
    SyntaxError: encoding problem: future_fstrings
    ubuntu@ubuntu:~/heap/libptmalloc$ 
    

    As you see I already have future strings. I tried to then delete it and install it via installation script:

    ubuntu@ubuntu:~/heap/libptmalloc$ pip3 uninstall future-fstrings
    Found existing installation: future-fstrings 1.2.0
    Uninstalling future-fstrings-1.2.0:
      Would remove:
        /home/ubuntu/.local/bin/future-fstrings-show
        /home/ubuntu/.local/lib/python3.10/site-packages/aaaaa_future_fstrings.pth
        /home/ubuntu/.local/lib/python3.10/site-packages/future_fstrings-1.2.0.dist-info/*
        /home/ubuntu/.local/lib/python3.10/site-packages/future_fstrings.py
    Proceed (Y/n)? Y
      Successfully uninstalled future-fstrings-1.2.0
    ubuntu@ubuntu:~/heap/libptmalloc$ cd ..
    ubuntu@ubuntu:~/heap$ pip3 install -r libptmalloc/requirements.txt
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: hexdump==3.3 in /home/ubuntu/.local/lib/python3.10/site-packages (from -r libptmalloc/requirements.txt (line 1)) (3.3)
    Collecting future-fstrings==1.2.0
      Using cached future_fstrings-1.2.0-py2.py3-none-any.whl (6.1 kB)
    Installing collected packages: future-fstrings
    Successfully installed future-fstrings-1.2.0
    ubuntu@ubuntu:~/heap$ 
    ubuntu@ubuntu:~/heap$ cd libptmalloc/
    ubuntu@ubuntu:~/heap/libptmalloc$ sudo python3 setup.py install
    SyntaxError: encoding problem: future_fstrings
    ubuntu@ubuntu:~/heap/libptmalloc$ 
    

    Which unfortunately yield the same result. Here is system info (note ARM 64)

    ubuntu@ubuntu:~/heap/libptmalloc$ uname -a
    Linux ubuntu 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:04:57 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
    ubuntu@ubuntu:~/heap/libptmalloc$ lsb_release -a
    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 22.04.1 LTS
    Release:	22.04
    Codename:	jammy
    
  3. saidelike commented on Nov 29, 2022

    @saidelike
    Collaborator

    I guess it is due to ARM64 as I might have not tried to install it on ARM64. I have just tried to install it on a AMD64 Ubuntu system and it worked fine.

    Can you use libptmalloc without installing it, just by importing it, following https://github.com/nccgroup/libptmalloc/blob/master/docs/InstallGuide.md#use-without-installation ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions