LoginSignup
12
13

More than 1 year has passed since last update.

Python3でpip install uuidしてはいけない件

Last updated at Posted at 2022-01-21

表題の件、正確に言えばPython2.5以降からですが、
uuidは標準ライブラリとしてバンドルされています。

なのでpip install uuidしてしまうと、

File "/Users/hoge/.pyenv/versions/3.8.0/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 9, in <module>
    import uuid
File "/Users/hoge/.pyenv/versions/3.8.0/lib/python3.8/site-packages/uuid.py", line 138
    if not 0 <= time_low < 1<<32L:

このようなエラーになります。
どうやらこれは2.5以降に標準ライブラリに含まれているモジュールのバックポートのようです。

もしインストールしてしまった場合

$ pip uninstall uuid

するか、
もしできなければ、ここでいうsite-packages内の

uuid-1.30.dist-info
uuid.py

そこにあるuuid.pyを削除すれば解消できます。
※ちゃんとrequiremetnts.txtからも消しましょう。

参考

12
13
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13