Anaconda Prompt(Anaconda3) does not recognize files in a directory - prompt

I took to heart the message that support for anaconda2 was dropped. I installed anaconda3 and used 2to3 to convert my *.py codes. Everything seemed to work as expected. I have several 2 line bat codes that cd to a particular directory and then call python to execute a particular *.py code in that directory. By loading Anaconda Prompt(Anaconda3) and invoking the bat file I could run pythons in that directory as expected.
Then, a couple of days ago, I made such a run and got an error message saying the *.py file could not be found. I immediately looked in the directory and the python file was there as expected. I then did a dir command in Anaconda Prompt(Anaconda3) and found that almost no files in the directory were listed. This was happening on my windows 10 laptop.
On my desktop, everything continues to work as expected. Are there any suggestions as to what could cause such a problem and how to fix it.
Thanks,
Mack Elrod
Responding to the request for additional information, I have a bin directory that is in path. In bin\MackData.bat is
c:
cd %USERPROFILE%\Documents\Medev\MackData
copy sugarhist.png sugarhist.old.png
python MackData.py
When I open Anaconda Prompt(Anaconda3) and enter MackData I get
(base) C:\Users\Mack>MackData
(base) C:\Users\Mack>c:
(base) C:\Users\Mack>cd C:\Users\Mack\Documents\Medev\MackData
(base) C:\Users\Mack\Documents\Medev\MackData>copy sugarhist.png sugarhist.old.png
1 file(s) copied.
(base) C:\Users\Mack\Documents\Medev\MackData>python MackData.py
python: can't open file 'MackData.py': [Errno 2] No such file or directory
(base) C:\Users\Mack\Documents\Medev\MackData>
But MackData.py is a python file in the directory MackData.
This code worked on this laptop until a few days ago and continues to work on my desktop computer. I can, of course, publish MackData.py but that seems irrelevant. The point is that Anaconda can't find it.
Thanks,
Mack
I must submit a sincere apology to this community. I have determined my problem and Anaconda is not responsible in any way. I thank all of you for you concerns and comments.
For any who might be interested I will give a brief outline of what happened. First, I installed Anaconda3. Several days later my directory, MackData, was moved to a new location. I conjecture that happened by me inadvertently letting my hand drag on the touch pad. Then, not knowing the location had changed I updated my laptop from my desktop. My update program not finding MackData where expected recreated it and put only the most recently changed files from the desktop into the new MackData. New but in the correct location. Then of course running my script in the Anaconda3 prompt failed. Doing a dir in the Anaconda3 prompt showed only a few files were there. I then went to Windows File Explore and looked at MackData and saw all of the expected files. I used the quick access feature which unknown to me pointed to the old directory in its new location.
That is not intended to be an excuse but only as an explanation. Again, I do apologize to the community.
Mack Elrod

I'm pretty sure newer anaconda launchers users different environment paths, and not even windows ones.
I suggest either checking the environment path within the anaconda launcher and configurations or, a better solution in my opinion, run these scrips using the regular python engine, without using anaconda (simpler, more determinant and works within your standard environment)

Related

Cannot connect to ipykernel Python 3 in Jupyter anymore

I am trying to learn more in Python. However, the fundamentals in terms of the software itself are hard to grasp for me. Let's say things got messy: I could not access all imports easily - so I decided to uninstall all Python related software to start over:
Uninstall Python, Jupyter and Anaconda
Re-install Anaconda and Python.
Installed it in C://Users/Mark/Anaconda
Added Python as PATH
But now I can not access my ipykernels anymore. It can not connect once I want to open a script I made. It asks which kernel I want to start every time. Was not the case before. It tries to connect but then says: "Disconnected".
I tried to move the ipynb files to the new root folder and open them from Path but no luck.
I tried to use cd in the Anaconda Prompt to set the root folder to C://Users/Mark/Anaconda
What is holding me from working scripts again?
I tried to move the ipynb files to the new root folder and open them from Path but no luck.
I tried to use cd in the Anaconda Prompt to set the root folder to C://Users/Mark/Anaconda

Anaconda Navigator does not open (Windows 10)

I just downloaded and installed Anaconda3 on windows 10 platform.
Apparently, the installation process finished successfully however I can't open Anaconda Navigator.
What I'm doing is just clicking on "Anaconda Navigator" icon from start menu.
After a while an empty console window pops up twice, then it desappears immediately without showing an error message and nothing seems to happen after that.
I've been reading about similar errors and found out that running this command, conda update --all might solve the problem.
I tried it out, but ended up getting a network connection problem for a particular URL.
But my internet connection is working fine since I'm actually able to access that URL from the browser and get a response.
It's worth mentioning that I've already uninstall Anaconda3 and set up the following user environment variables.
Any help would be appreciated, thanks in advance!
Finally found a solution to this problem, I recommend you to read the official documentation and follow the steps described there in order to make sure everything was installed correctly.
Check out this article:
https://docs.anaconda.com/anaconda/install/verify-install/
After trying to starting up Anaconda Navigator from the console I got this specific error that helped me to get a final solution.
Basically I just had to move some files within anaconda3 installation folder from one path to another.
Navigate to %ANACONDA_HOME%\Library\bin, there you will find the files listed below
libcrypto-1_1-x64.dll
libcrypto-1_1-x64.pdb
libssl-1_1-x64.dll
libssl-1_1-x64.pdb
So, just move them to this path: %ANACONDA_HOME%\DLLs
Give it a try one more time and you will be able to run it.
Note:
%ANACONDA_HOME% refers to Anaconda3 installation folder in your computer.
This answer is based on this link: Anaconda navigator not launching windows 10 (Spyder as well)

Unable to get python3 to work in Git on Windows10

I have installed the latest windows 10 version of Git v 24 and use the standard recommended install as shown on a number of websites including https://zarkom.net/blogs/how-to-install-git-and-git-bash-on-windows-9140
he has said that his install recommends for vers 19 are still ok for v24 and just click on Next etc. I have had this confirmed with other help guides but on install I type in after the $ sign either python and or python3 and nothing happens but I can see when running a test file the bash:
/c/Users/nigel/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
I don't have python3 installed there but in standard C:\Users\nigel\AppData\Local\Programs\Python.
I have powershell running ok and am using Sublime Text 3 ok I can run code I prepare in Powershell version 5.6.. whatever it is now standard install part of Windows10. No issues running Python IDLE either.
When I search the reg with regedit and type in git bash I cannot trace this odd link to Microsoft/*/Python as above but in that folder there is an odd link not seen previously not sure what installed that other than sometime ago I might have started an instll of python via M store but sure I didn't but this odd python language server may have got installed through something else?
C:\Users\nigel\AppData\Local\Microsoft\Python Language Server\stubs.v1 is all I can find but in windowapps I found 0kb of a couple of files that are odd ie python.exe and python3.exe and size says 0kb.
I cant seem to find how to amend git so that it stops looking in this odd location and looks in correct folder as stated above ie C:\Users\nigel\AppData\Local\Programs\Python
I would appreciate any help although I am using powershell and ST3 ok on my python courses on UDEMY. I have tried to look at environmental path etc but cant see any reference to this odd path link with windowapps ? I have amended path ok previously for other editors or ensured that the path was pointing to correct python. The only other version of python I have is with Jupyter/ananconda but that is self contained my word ie it doesn't fire up unless I am in Anaconda or jupyter hope that makes sense which I use on another course ie bootcamp course

PyCharm's python interpreter error related to Anaconda3 and system

I installed JetBrains Pycharm Community Edition, a python interpreter there was that of Anaconda3. When I run the project there was an error that tensorflow was not installed, however it was installed to my system itself not into anaconda's base environment. Then I deleted Anaconda from Control Panel as usual program uninstallation method and set the python interpreter of Pycharm to System Interpreter (C:\Python354\python.exe). When I run the project it gives the following error:
Error running 'Server': Cannot run program "C:\Users\username\Anaconda3\python.exe" (in directory "D:\Projects\TopViewPeopleCounter"): CreateProcess error=2, The system cannot find the file specified
Although I uninstalled Anaconda, PyCharm is still looking for it as its interpreter. Then I tried to delete that Anaconda folder, but some folders inside it (__pycache__, python) are not deleted. Naturally I tried several ways of deleting it with no success:
Uncloker did not help;
cmd command did not help (/f del, /f rmdir );
Disk cleanup did not help;
Archiving the file and deleting hack did not help.
In short, the file is not deleted, when I try to access those folders pop-up window says:
The file or directory is corrupted and unreadable.
I should note that I copied the parent folder of those two folders from another place (my previous python's \Lib\site-packages) several days ago, it was copied into C:\Users\username\Anaconda3\Lib\site-packages
I feel I should have issued this long before all that happened, but I honestly tried to solve it by myself.
Any further actions are aprreciated.

Anaconda install on Windows is stuck on executing install.py

Update: Two months after posting this question, I switched to a fresh install of Windows 10 and was able to install the correct version of Anaconda Python. Unfortunately the answers came too late for me to test them.
I want to switch from the 32-bit version of Anaconda Python 3.5 to the 64-bit version. First I uninstalled Anaconda through the 'Programs and Features' window, then I downloaded the Anaconda3-4.2.0-Windows-x86_64.exe installer and attempted to run it. For reference, I am using the 64-bit version of Windows 7. After some initial processing the installer is stuck on Execute: "C:\Users\user.name\AppData\Local\Continuum\Anaconda3\pythonw.exe" -E -s "C:\Users\user.name\AppData\Local\Continuum\Anaconda3\pkgs\.install.py" --root-prefix "C:\Users\user.name\AppData\Local\Continuum\Anaconda3" --post root
It does not throw any errors, it just hangs. I let it run throughout the night to see if it would progress any further, but unfortunately it was still stuck in the same place in the morning. Afterwards I tried looking for hidden Continuum files from the previous installation and removed those - also removed Anaconda from my PATH variable. I even tried installing miniconda instead of anaconda, but both installers get stuck in the exact same place. Am I missing a hidden file somewhere which is causing the Anaconda installer to hang?
Below is part of the installation log up until the execution command where it gets stuck.
Installing: dill-0.2.5-py35_0 (into root)
untgz::extract -d 'C:\Users\user.name\AppData\Local\Continuum\Anaconda3' -zbz2 'C:\Users\use.name\AppData\Local\Continuum\Anaconda3\pkgs\dill-0.2.5-py35_0.tar.bz2'
Writing Lib/site-packages/dill-0.2.5-py3.5.egg-info
Writing Lib/site-packages/dill/__diff.py
Writing Lib/site-packages/dill/__init__.py
Writing Lib/site-packages/dill/__pycache__/__diff.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/__init__.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/_objects.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/detect.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/dill.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/info.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/objtypes.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/pointers.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/settings.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/source.cpython-35.pyc
Writing Lib/site-packages/dill/__pycache__/temp.cpython-35.pyc
Writing Lib/site-packages/dill/_objects.py
Writing Lib/site-packages/dill/detect.py
Writing Lib/site-packages/dill/dill.py
Writing Lib/site-packages/dill/info.py
Writing Lib/site-packages/dill/objtypes.py
Writing Lib/site-packages/dill/pointers.py
Writing Lib/site-packages/dill/settings.py
Writing Lib/site-packages/dill/source.py
Writing Lib/site-packages/dill/temp.py
Writing Scripts/get_objgraph.py
Writing Scripts/unpickle.py
Writing info/LICENSE.txt
Writing info/files
Writing info/has_prefix
Writing info/index.json
Writing info/platform
Writing info/recipe/bld.bat
Writing info/recipe/build.sh
Writing info/recipe/meta.yaml
extraction complete.
Execute: "C:\Users\user.name\AppData\Local\Continuum\Anaconda3\pythonw.exe" -E -s "C:\Users\user.name\AppData\Local\Continuum\Anaconda3\pkgs\.install.py" --root-prefix "C:\Users\user.name\AppData\Local\Continuum\Anaconda3" --post root
I simply ended all python processes (any stale anaconda install/uninstall process running) and deleted all directories created during previous installation attempt. Then I could install without trouble.
If above effort does not work, check the environment path variables. It should not include any python path.
I have ended pythow process from taskmanager and removed unnecessary/irrelevant from environment path. It resolves my issues.
Try this, it worked for me:
conda install python=3.5
conda install tensorflow
Temporary disable antivirus and then try.
For me the installation was extremely slow, especially during the "unpacking" phase. After I disabled the "Real-time protection" under "Virus & threat protection" - the installation continued much faster.
I solved this issue by doing the following:
The installation was stuck on "extracting: anaconda-2020.02-py37_0.tar.bz2".
I went to https://anaconda.org/anaconda/anaconda/files and installed that file manually.
I extracted that file in the anaconda folder and it was all good!
As mentioned by ClaraJacintho in https://github.com/ContinuumIO/anaconda-issues/issues/6258#issuecomment-565063685:
I found that the "security module" called Warsaw (or GAS antifraud), used by many banks in Brazil for internet banking security, was interfering with the installation. I uninstalled it and was able to install Anaconda3.2019.10 64 bits on my Windows 10 machine.
It worked for me.

Resources