I am trying to install anaconda version anaconda 3 -2019-07 -64 on my window 10 what i noticed was after few minutes of starting installation i can see the icon of anaconda navigator , spyder , jyupter in my start menu but as the installation process continues it shows that an error occurred while installing package file not found ( the system cannot find the specified file none,2,none ) attempting to roll back and Path not writable or missing. environment location
and then all the icon of spyder navigator etc disappear and i am not able to find them anywhere in my entire computer . i have reinstalled it several times and also tried previous version but still same error shows .
plz help……..
here is the error
ERROR conda.core.link:_execute(637): An error occurred while installing package 'defaults::qt-5.9.7-vc14h73c81de_0'.
FileNotFoundError(2, 'The system cannot find the file specified', None, 2, None)
Attempting to roll back.
Rolling back transaction: ...working... DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:UsersLenovoAnaconda3', env_name: 'Anaconda3', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(324): Shortcut cmd is C:UsersLenovoAnaconda3pythonw.exe, args are ['C:\Users\Lenovo\Anaconda3\cwp.py', 'C:\Users\Lenovo\Anaconda3', 'C:\Users\Lenovo\Anaconda3\pythonw.exe', 'C:\Users\Lenovo\Anaconda3\Scripts\spyder-script.py']
DEBUG menuinst_win32:create(324): Shortcut cmd is C:UsersLenovoAnaconda3python.exe, args are ['C:\Users\Lenovo\Anaconda3\cwp.py', 'C:\Users\Lenovo\Anaconda3', 'C:\Users\Lenovo\Anaconda3\python.exe', 'C:\Users\Lenovo\Anaconda3\Scripts\spyder-script.py', '--reset']
DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:UsersLenovoAnaconda3', env_name: 'Anaconda3', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(324): Shortcut cmd is C:UsersLenovoAnaconda3python.exe, args are ['C:\Users\Lenovo\Anaconda3\cwp.py', 'C:\Users\Lenovo\Anaconda3', 'C:\Users\Lenovo\Anaconda3\python.exe', 'C:\Users\Lenovo\Anaconda3\Scripts\jupyter-notebook-script.py', '"%USERPROFILE%/"']
DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:UsersLenovoAnaconda3', env_name: 'Anaconda3', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(324): Shortcut cmd is C:UsersLenovoAnaconda3pythonw.exe, args are ['C:\Users\Lenovo\Anaconda3\cwp.py', 'C:\Users\Lenovo\Anaconda3', 'C:\Users\Lenovo\Anaconda3\pythonw.exe', 'C:\Users\Lenovo\Anaconda3\Scripts\anaconda-navigator-script.py']
DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:UsersLenovoAnaconda3', env_name: 'Anaconda3', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(324): Shortcut cmd is %windir%System32WindowsPowerShellv1.0powershell.exe, args are ['-ExecutionPolicy', 'ByPass', '-NoExit', '-Command', '"& 'C:\Users\Lenovo\Anaconda3\shell\condabin\conda-hook.ps1' ; conda activate 'C:\Users\Lenovo\Anaconda3' "']
DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:UsersLenovoAnaconda3', env_name: 'Anaconda3', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(324): Shortcut cmd is %windir%System32cmd.exe, args are ['"/K"', 'C:\Users\Lenovo\Anaconda3\Scripts\activate.bat', 'C:\Users\Lenovo\Anaconda3']
done
[WinError 2] The system cannot find the file specified
()
Delete file: C:UsersLenovoAnaconda3pkgsenv.txt
Output folder: C:UsersLenovoAnaconda3conda-meta
Extract: history
Creating Anaconda3 menus...
Execute: "C:UsersLenovoAnaconda3pythonw.exe" -E -s "C:UsersLenovoAnaconda3Lib_nsis.py" mkdirs
Running post install...
Execute: "C:UsersLenovoAnaconda3pythonw.exe" -E -s "C:UsersLenovoAnaconda3Lib_nsis.py" post_install
Execute: "C:UsersLenovoAnaconda3pythonw.exe" -E -s "C:UsersLenovoAnaconda3Lib_nsis.py" addpath 3.7.3 Anaconda3 2019.07 64-bit
Execute: "C:UsersLenovoAnaconda3pythonw.exe" -E -s "C:UsersLenovoAnaconda3pkgs.cio-config.py" "C:UsersLenovoDownloadsAnaconda3-2019.07-Windows-x86_64.exe"
Created uninstaller: C:UsersLenovoAnaconda3Uninstall-Anaconda3.exe
Completed
Anaconda not available in PyCharm
I have just installed Anaconda 3.6 and PyCharm. I am trying to set up the interpreter, however if I navigate to the interpreter window I can see the error message saying «Conda executable not found» as well as «Environment location directory is not empty».
Please see the screenshot below. Do you have any suggestion what I could do? I deleted Anaconda and Pycharm already and re-installed them again without success. I must also say that my untitled folder under Location is already empty.
Как связать интерпретатор Python 3.7.0 с Pycharm на Mac
Я только недавно обновил до Python 3.7.0 на моем Mac с помощью установки Homebrew. К сожалению, этот процесс привел к удалению моей предыдущей версии 3.6.5, и в результате Pycharm больше не связывается с переводчиком. Я вошел в меню Pycharm следующим образом: Pycharm >> Preferences >> Project Interpreter и попытался добавить новую ссылку на путь к установке 3.7.0, которая была в Users/myname/usr/local/Cellar/python3/3.7.0/bin/python3.7 и я получаю сообщение Environment location directory is not empty что указывает на то, что я не связываюсь с нужным элементом, но если это не так, я не уверен, куда мне следует ссылаться. Может кто-то указать мне верное направление?
Python 3.7 altinstall и установка PIP: PyCharm: система unix
Я решил, что хочу протестировать новейшую версию Python. Я загрузил из источника и выполнил altinstall, поэтому python3.7 (полный) находится в usr / local / lib, а его исполняемый файл — @ usr / local / bin. Я думал, что простой способ установить модули — это выбрать этот исполняемый файл в качестве моего интерпретатора проекта в PyCharm и использовать его диспетчер пакетов для установки pip и многого другого. Однако, когда я выбираю исполняемый файл 3.7 в качестве среды: Virtualenv Environment, он не позволяет мне нажать «ОК». Вместо этого в нижнем левом углу окна отображается предупреждение:
Поэтому я попытался выбрать исполняемый файл в качестве системного интерпретатора, и он в определенной степени работает. Это позволяет мне нажать ОК, но в окне диспетчера пакетов внизу есть желтая полоса, которая говорит:
Поэтому, если я нажимаю ссылку, он пытается установить (требуется sudo), а затем вместо установки появляется окно с предупреждением:
Итак, как мне заставить PyCharm использовать 3.7 s / t, я могу установить для него модули?
Вы нашли способ решить эту проблему?
Похоже, вам не хватает пакета libffi-dev. Сначала установите его перед сборкой python (так что установите yum / apt-get / something install libffi-dev, затем перейдите в pythondir и перекомпилируйте (т.е. сделайте altinstall)), затем повторите попытку. Обратите внимание, что PyCharm зависит от установленного pip3.7, он должен поставляться с python3.7.
The Python error “OSError: [Errno 39] Directory not empty” occurs when you try to remove a directory that has other files or directories in it. Functions like os.rmdir() or .rmdir() on a pathlib Path object can only remove directories that are already empty. To fix this, you can either delete all the files in the directory first with a for loop, or use a function like shutil.rmtree(<your dirname>) to remove the directory and all its contents.
Python makes it super easy to deal with files and do simple file operations. Unfortunately, some of the things you want to do with files aren’t as straightforward as they might seem on the surface. For example, if you want to delete a directory, you need to make sure its empty first. That is, unless you use shutil.rmtree(); os.rmdir() won’t work.
Fortunately, we’re here to help. There’s lots of options for you when it comes to deleting a directory that’s not empty. Ignoring the most obvious first choice which is simply “don’t do that”, of course.
Let’s start with the problem!
❌ Problem: you are using os.rmdir() or pathlib‘s .rmdir() to remove a directory that isn’t empty
Again, deleting a directory that’s not empty in Python isn’t impossible, but you have to do it the right way. Let’s look at an example directory below:
. ├── main.py ├── testdir ├── testdir2 │ ├── test2.txt │ ├── testdir3 │ │ └── another_test.txt │ └── test.txt └── test.txt
As you can see, we got lots of stuff in here. Aside from our main.py above, which is our Python script, we have testdir as well as a bunch of nested files and directories inside.
You might try to just go ahead and do something like this, but you’d be wrong:
import os
os.rmdir('testdir')
Here, we’re using the good old os.rmdir(<your dirname>) to try to delete testdir. That’s not gonna work. If you try to do this, you’ll get the following error message:
Traceback (most recent call last):
File "/home/user/main.py", line 3, in <module>
os.rmdir('testdir')
OSError: [Errno 39] Directory not empty: 'testdir'
Oops! But you already knew that was going to happen. That’s why you’re here, after all. Luckily this Python error has a pretty straightforward message for us: the directory isn’t empty. Like using rm on Linux or Mac that isn’t empty, we can’t do this!
✅ Fix 1: use shutil.rmtree() to delete the directory and all its contents
This is the simplest way to delete a directory that isn’t empty in Python. But be warned, this will delete everything in that directory, including the directory itself. If you’re absolutely sure this is what you want to be doing, here’s how you’d do it:
import shutil
shutil.rmtree('testdir')
Can’t get much easier than that. But what if you wanted more control over the deleting of stuff within testdir?
✅ Fix 2: delete all files in the directory first
If you don’t want to just blow away an entire directory and all its contents, you might want to recursively delete everything in the directory, including all of its subdirectories. This is useful if you want to do something like logging the filenames you’re deleting, or optionally moving certain files during the process that match specific criteria.
To recursively delete a directory and all its contents in Python, you can use this function I wrote:
import pathlib
def recursive_delete(dir_obj: pathlib.Path):
assert dir_obj.is_dir()
for file_obj in dir_obj.iterdir():
if not file_obj.is_dir():
file_obj.unlink()
else:
recursive_delete(file_obj)
dir_obj.rmdir()
recursive_delete(pathlib.Path('testdir'))
Here, we wrote a function called recursive_delete() that takes a pathlib Path object. First, we check to make sure it’s actually a directory. That’s important. If it’s not, nothing else in the function will work properly. Then, we loop through each file in that directory. If that directory is a file, we just remove it. Otherwise, we recurse back into our recursive_delete function to start the process over again. Finally, we remove the directory that recursive_delete was called on once its empty.
Feel free to copy / paste this function and add more to it – this is just a bare-bones example that doesn’t do much that shutil.rmtree() doesn’t already do (in much fewer lines of code). If all you’re wanting to do is delete a directory and all its contents, use shutil.rmtree() instead.
✅ Fix 3: use an if / else statement to check if the directory is empty first
If you don’t want to remove directories that have stuff in them, but receiving the name of a directory that has stuff in it isn’t an error state for your application, you should check if the directory is empty first before trying to remove it.
Here’s how you’d do that:
import os
dir_to_delete = 'testdir'
if len(os.listdir(dir_to_delete)) == 0:
os.rmdir(dir_to_delete)
else:
print(f"{dir_to_delete} is not empty!")
# do something useful...
# -> testdir is not empty!
Here, we first call os.listdir() on the directory name first, which will give us a list of all filenames it contains. We do that in an if statement where we use len() on the returned list of filenames to make sure it equals 0, which means it’s empty. If it’s not empty, we just print out a complaint to the user.
Now, you’ll want to do something more than that here, otherwise you might as well not check at all and let the program crash with a stack trace instead.
✅ Fix 4: use a try / except block to catch the exception
If you aren’t expecting to receive the name of a directory that’s got stuff in it and that is an error state for your program but you don’t want the program to just crash, you should use a try / except block instead like so:
import os
dir_to_delete = 'testdir'
try:
os.rmdir(dir_to_delete)
except OSError as ose:
print(ose)
# do something useful...
# -> [Errno 39] Directory not empty: 'testdir'
Here, we simply try to delete the directory, and if it’s full, we catch the OSError and print it out. You should also do something in the except block that is more useful than that, otherwise there’s not much point in catching the error to begin with.
As always, you want to be as specific as possible when catching exceptions. This makes sure that you’re not catching everything and possibly masking a deeper problem with your application logic. Here, by specifically catching OSError, we avoid this.
Conclusion
In this article we covered what causes “OSError: [Errno 39] Directory not empty” and how to avoid it. In general, it’s always caused by trying to remove a directory that isn’t empty yet. The simplest way to handle it is to use shutil.rmtree(<your dirname>) to delete the directory and all its contents. If you need more control, use the recursive function I provided above. And if you don’t actually want to remove a directory with everything in it, use an if / else statement or a try / except block instead.
That’s all for now, hope it helps!
Не обновляется Java. Пишет This folder is not empty. Что делать?
Java несомненно является очень важным приложением, которое должно присутствовать на каждом компьютере и ноутбуке, работающем под операционной системой Windows. В этой статье мы уже рассматривали его назначение, а также причины почему на каждом ПК должна находиться актуальная версия java.
К сожалению не обошлось без проблем. А именно проблем с установкой. Так, некоторые пользователи отмечают достаточно частое возникновение ошибки с текстом “This folder is not empty. Please select an empty folder”, появляющееся во время установки или обновления Java.
В данной статье мы расскажем вам как установить/обновить Java, если в процессе возникает эта ошибка.
Что означает ошибка ?
Чтобы разобраться в сути проблемы, достаточно перевести текст ошибки на русский язык. Так, перевод “This folder is not empty. Please select an empty folder” звучит следующим образом: Эта папка не пуста. Пожалуйста, выберите пустую папку.
Получается, что устанавливать java нужно в пустую папку. В вашем случае каталог, указанный после слов install to: не является пустым!

Путь, по которому будет устанавливаться Java
Что делать?
Решение очень простое. Нужно на диске C или в любом другом месте создать пустой каталог, например с именем Java, и в программе установки нажать на кнопку “Change..” (изменить), чтобы выбрать вновь созданную пустую папку. В нашем примере с именем Java.

Создание пустой папки с именем Java в каталоге program files на диске C
После этого кнопка “Next” (далее) станет активной и процесс установки будет запущен.

Выбор только что созданной пустой папки для установки
Вывод
Ошибка “This folder is not empty. Please select an empty folder”, из-за которой невозможно продолжить установку/обновление Java, появляется по причине наличия каких-либо файлов или папок в каталоге, выбранном для установки.

Установка актуальной версии Java
Решением проблемы является создание пустой папки с любым именем на диске C (или на любом другом локальном диске) и указанием в установщике этой самой папки, нажав кнопку “Change”.
Лучшая благодарность автору — репост к себе на страничку: