Strange behavior when importing os.path

I'm not quite sure this question belongs to StackOverflow and not to another SE website, but since it is related to python, I thought it could fit.

Recently, I started getting an error in my IDE (details about my IDE below) - I get the error message "cannot find the path link in" os.py "" Looking at os.py, I understand that os. path is just an alias for posixpath.py (on Linux) or ntpath.py (on Windows). Now there were no changes in my installation on python, and when I run scripts that import os.path (or from it), they all work fine, so there is no real error, just annoying warnings in my IDE. I tried to change the project interpreter in the IDE and it did not work. I also tried to work with the terminal with the specified IDE, and it worked fine. Maybe this is a bug in PyCharm?

I looked online and could not find a bug report or someone who is struggling with the same problem.


PyCharm build details:

PyCharm 2018.1 (Community Edition) Build # PC-181.4203.547, built March 26, 2018 JRE: 1.8.0_152-release-1136-b20 amd64 JVM: 64-bit OpenJDK virtual machine from JetBrains sro Linux 4.7.0-0.bpo .1-amd64

+4
source share
2 answers

This is a bug that was fixed in 2018.1.1 https://youtrack.jetbrains.com/issue/PY-28764

+6
source

I assume this is a bug (or behavior) introduced in the latest version of PyCharm. Indeed, this has been happening to me since the last update I recently installed.

However, I temporarily ignored these unresolved links in PyCharm to avoid annoying and misleading warnings.

, os.path ():

from os.path import join

PyCharm → →

" " "Python" :

  • os.path

, , Giuliano

+2

Source: https://habr.com/ru/post/1695664/


All Articles