How to get rid of library root mark in PyCharm
I’ve started working on a Pyramid application, which requires setup.py usage, but as soon as I built the app, my app folder was marked as library root.
It is not convenient, because when I open a file, it is also opened under External Libraries unfolding it. This can be «fixed» by removing check on Always Select Opened File, but I like this feature, so I don’t want to disable it.
I’ve also tried to tweak Project Structure in settings, but it didn’t help.
How to get rid of this _library_root_ mark?

UPD. Contents of setup.py :

asked Dec 11 '19 21:12
stasdeep
People also ask
Content root types A content root is a folder that contains the files that make up your project. Source roots (or source folders; shown as ). These roots contain the actual source files and resources. PyCharm uses the source roots as the starting point for resolving imports.
Open the Project Structure settings. In the Projects pane of the Project Structure page, click the project you want to configure content roots for. In the dialog that opens, locate the desired directory and click OK.
Change the location of IDE directories From the main menu, select Help | Edit Custom Properties. Specify paths with forward slashes /, including Windows paths (for example, C:/idea/system). After you restart PyCharm, it will use the new location of the corresponding directory.
Open File > Settings > Project from the PyCharm menu. Select your current project. Click the Python Interpreter tab within your project tab. Click the small + symbol to add a new library to the project.
1 Answers
The reason why it happens is PyCharm adds sd-blog/app to the interpreter paths once you pip install -e in order to be able to provide completion for app objects. Possible workaround:
remove app from the interpreter paths

mark sd-blog/app as a source root to restore the code insight broken in the step 1

answered Oct 05 '22 00:10
В структуре проекта почему показывается исключенная папка -> venv
Я новичок в Питоне. Если я создаю новый проект в PyCharm, в структуре проекта он показывает это:
Почему это отображается так?

1 ответ
Когда вы создаете новый проект в последних версиях PyCharm, по умолчанию автоматически создается новая виртуальная среда для вашего проекта.
Это не обязательно, но я настоятельно рекомендую его, поскольку он предоставит вашему проекту собственную изолированную изолированную программную среду Python, так что вы сможете устанавливать дополнительные пакеты, не мешая требованиям к пакетам других ваших проектов или глобального Python. установка в вашей системе.
По умолчанию эта виртуальная среда будет создаваться в папке вашего проекта в подпапке с именем venv это то, что вы видите.
Почеиу в винде venv помечается как library root?
Я не говорю что что-то не так, просто на линуксах такого не было.
а где именно это отображается/не отображается?
PyCharm, в дереве каталогов.
Похожие вопросы
Почему вылезает эта ошибка, если такой модуль имеется?
Если мне нужно делать http-запросы и записывать результаты в БД sqlite, мне лучше использовать asyncio или threading?
А через user.id тоже нет никаких вариантов ?
Привет, столкнулся с проблемой, что не у всех есть username как отмечать пользователей которые без него ?( По типу @username ) Telegram bots
Капец, что бы я не сделал, всё не правильно. Я начал смотреть один урок, начали говорить что урок хрень, начал писать ботов, тоже хрень, читаю книгу по питону, тоже хрень. Дак.
Почему бот перестает работать после закрытия консоли?

Проект Джанго. Когда я выполняю команду в консоле: export SITE_ADDRESS=http://127.0.0.1:8000 В environ создается переменная SITE_ADDRESS, которая успешно читается в Caddyfile.
Добрый день! как сделать максимально хардварный клик ? у меня в одном окне не работает ни один из вариантов гуглящихся библиотек для клика
норм практика создавать в классе метод, который позволяет создавать экземпляр этого класса и возвращать его?
How to get rid of library root mark in PyCharm
I’ve started working on a Pyramid application, which requires setup.py usage, but as soon as I built the app, my app folder was marked as library root.
It is not convenient, because when I open a file, it is also opened under External Libraries unfolding it. This can be «fixed» by removing check on Always Select Opened File, but I like this feature, so I don’t want to disable it.
I’ve also tried to tweak Project Structure in settings, but it didn’t help.