Janis Börsig
Janis Börsig

Reputation: 61

pip is not working when called on a specific Python version

Example:

$ sudo python3.7 -m pip install pandas
[sudo] password for janis: 

Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 290, in run
    with self._build_session(options) as session:
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 69, in _build_session
    if options.cache_dir else None
  File "/usr/lib/python3.7/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not int

Ubuntu 18.04

I have already reinstalled python3.7 but it still does not work.

Any ideas? Thanks!

Upvotes: 2

Views: 2051

Answers (1)

Janis Börsig
Janis Börsig

Reputation: 61

The problem was the cache. You can circumvent this by writing this instead:

python3.7 -m pip install --no-cache-dir pandas

Upvotes: 4

Related Questions