I've installed the Anaconda3 64 bit on my windows 10 64 bit.
Added to environment variable the path and script directory as well. Installation was successfull.
When I type anaconda in command prompt it give me the following
Neither of any application of navigator launch, when I click a loading bar appears for 2-3 seconds and disappears without opening program.
And one more thing, when jupyter program runs, from which directory does it runs, I mean if I have program.py how can I run it via jupyter ?
What are you trying to do when launching anaconda? In my experience (on a mac) you use conda for (primarily) installing and managing python packages within your anaconda installation.
If you are trying to open an python interpreter, try typing ipython.
In answer to your jupyter question, it should run from whatever directory you call it from. See here for details.
Related
I have a Python Project that has a bunch of dependencies (in my VirtualEnv). I need to run my project in my school computer for Demonstration. My School computer does not have python installed, and lets assume also wont have an Internet connection to install it. I have written the program in Windows 10, and the school computer runs Windows 7.
I have looked at these solutions so far, and also here is why I think they may not work.
Copy and pasting my virtual Env - Doesnt work because venv's have their own structures and has my username in its paths which it will look for in the other system.
Using Py2Exe. I have an Exe file, that I can now run on other systems running Windows 10 without them having python or any of my packages. But I am not sure the VC++ dependencies will be present in windows 7. It may also have some other weird issue that I cant risk.
Docker. I am not familiar with Docker, but can do it if this happens to be the only way.
How can I run the python file in that computer?
Also note that I will not have the time to mess around in the other system. Ideally I must plug in my USB and Open the file to run it. If you think there isn't a solution to this, please let me know by telling so.
Thanks!
I see two options.
Use an online IDE and Python Interpreter (assuming you did not have internet for downloading Python, but do have internet in general). I suggest replit.
Use a portable version of Python. Those are available in the official website and are called "Windows embeddable package". You can test downloading it to a usb, and running it in some computer without Python; it should work.
You can use PyInstaller to generate an exe file from your code. It runs without installation.
Or you have a look at the WinPython distribution which is portable and comes with several tools and packages pre-installed.
Note that Windows 7 only supports Python up to version 3.8. 3.9 is only supported on Windows 10 and will silently fail to run without giving you any hint.
Try python as a portable version.
Download the python Windows embeddable package(zip package) and extract it to your flash drive.
https://www.python.org/downloads/windows/
In extracted python folder, press the shift key + right click and select open command window(windows 7) / open powershell window here(windows 10) option.
Type './python' and hit the enter key.
Convert that python file to a .exe file using auto-py-to-exe. This would convert your .py to a .exe file which you can run anywhere.
To use auto-py-to-exe, just execute the following command on terminal pip install auto-py-to-exe.
Now on the terminal write auto-py-to-exe and press enter. Select the python file you wanna execute anywhere and click on Convert .py to .exe and you would get the folder containing the .exe file. Transfer this folder to any computer and just by clicking the .exe file that is there inside the folder, the program would start executing normally no matter if the computer does not have python or pycharm installed.
This is how I cloned a Windows Python project from a source machine to a target machine without internet connection where Python isn't installed.
Thanks to conda-pack tool (https://conda.github.io/conda-pack/).
On the source machine
Install Anaconda (https://www.anaconda.com/products/individual).
Then from Anaconda prompt type the following commands.
conda activate
conda update -c defaults conda
conda install conda-pack
conda create -n <my_env_name> python=<python_version_number>
conda activate <my_env_name>
# if using Python Windows extensions:
conda install pywin32
Now install the packages you need for your Python project using conda or pip (https://www.anaconda.com/blog/using-pip-in-a-conda-environment).
For instance "conda install <package_name>" or "pip install <package_name>".
And finally export everything to a zip file:
# Pack Python environment my_env_name into my_env.zip
conda pack -n <my_env_name> -o my_env.zip
On the target machine
The OS of the source machine must match the OS of the target. This means that environments built on Windows can’t be relocated to Linux.
Unpack my_env.zip and then execute the following commands from Command Prompt.
call Scripts\activate.bat
conda-unpack
# At this point the Python environment is exactly as if you installed it here directly
I use https://colab.research.google.com. It will work on any computer, but some codes can't be submitted there.
I have a Python Project that has a bunch of dependencies (in my VirtualEnv). I need to run my project in my school computer for Demonstration. My School computer does not have python installed, and lets assume also wont have an Internet connection to install it. I have written the program in Windows 10, and the school computer runs Windows 7.
I have looked at these solutions so far, and also here is why I think they may not work.
Copy and pasting my virtual Env - Doesnt work because venv's have their own structures and has my username in its paths which it will look for in the other system.
Using Py2Exe. I have an Exe file, that I can now run on other systems running Windows 10 without them having python or any of my packages. But I am not sure the VC++ dependencies will be present in windows 7. It may also have some other weird issue that I cant risk.
Docker. I am not familiar with Docker, but can do it if this happens to be the only way.
How can I run the python file in that computer?
Also note that I will not have the time to mess around in the other system. Ideally I must plug in my USB and Open the file to run it. If you think there isn't a solution to this, please let me know by telling so.
Thanks!
I see two options.
Use an online IDE and Python Interpreter (assuming you did not have internet for downloading Python, but do have internet in general). I suggest replit.
Use a portable version of Python. Those are available in the official website and are called "Windows embeddable package". You can test downloading it to a usb, and running it in some computer without Python; it should work.
You can use PyInstaller to generate an exe file from your code. It runs without installation.
Or you have a look at the WinPython distribution which is portable and comes with several tools and packages pre-installed.
Note that Windows 7 only supports Python up to version 3.8. 3.9 is only supported on Windows 10 and will silently fail to run without giving you any hint.
Try python as a portable version.
Download the python Windows embeddable package(zip package) and extract it to your flash drive.
https://www.python.org/downloads/windows/
In extracted python folder, press the shift key + right click and select open command window(windows 7) / open powershell window here(windows 10) option.
Type './python' and hit the enter key.
Convert that python file to a .exe file using auto-py-to-exe. This would convert your .py to a .exe file which you can run anywhere.
To use auto-py-to-exe, just execute the following command on terminal pip install auto-py-to-exe.
Now on the terminal write auto-py-to-exe and press enter. Select the python file you wanna execute anywhere and click on Convert .py to .exe and you would get the folder containing the .exe file. Transfer this folder to any computer and just by clicking the .exe file that is there inside the folder, the program would start executing normally no matter if the computer does not have python or pycharm installed.
This is how I cloned a Windows Python project from a source machine to a target machine without internet connection where Python isn't installed.
Thanks to conda-pack tool (https://conda.github.io/conda-pack/).
On the source machine
Install Anaconda (https://www.anaconda.com/products/individual).
Then from Anaconda prompt type the following commands.
conda activate
conda update -c defaults conda
conda install conda-pack
conda create -n <my_env_name> python=<python_version_number>
conda activate <my_env_name>
# if using Python Windows extensions:
conda install pywin32
Now install the packages you need for your Python project using conda or pip (https://www.anaconda.com/blog/using-pip-in-a-conda-environment).
For instance "conda install <package_name>" or "pip install <package_name>".
And finally export everything to a zip file:
# Pack Python environment my_env_name into my_env.zip
conda pack -n <my_env_name> -o my_env.zip
On the target machine
The OS of the source machine must match the OS of the target. This means that environments built on Windows can’t be relocated to Linux.
Unpack my_env.zip and then execute the following commands from Command Prompt.
call Scripts\activate.bat
conda-unpack
# At this point the Python environment is exactly as if you installed it here directly
I use https://colab.research.google.com. It will work on any computer, but some codes can't be submitted there.
I'm trying to use anaconda with visual studio code but keep getting this error message every time I try to run something.
enter image description here
enter image description here
What Iv'e tried/confirmed:
Python 3.9.1 is installed and Iv'e got no problems running codes in VSC when I use the standard enviroment or inside a command terminal.
The version of python the anacoanda says it is using is 3.8.5. Should it be 3.9.1 or is that normal?
Python and anaconda were added to path during installation - Iv'e already made that mastake before.
Presumably anaconda is installed properly. I can access the navigator and command prompt.
Its not the code that Iv'e writen. I tried simply writing print("Hello") and it gives me the same error.
Installed the latest version of anaconda.
I have encountered the same problem. The reason is that VS Code uses the powershell terminal by default, but powershell does not activate the conda environment by default.
Therefore, it is recommended that you use the cmd terminal or other terminals that come with the system. (Because in VS Code, the terminal it uses is to integrate the terminal from the system and it not only supports the powershell terminal.)
Solution: for example, switch to using cmd terminal:
Reference: Integrated terminal in VS Code.
I have the lat4est version of Anaconda, Python v3.8 installed on my system running on Windows 10 Pro. I have not installed Anaconda in the default drive but set the path for Python, conda to the installed drive. But in spite of doing everything right as it seems, the Jupyter notebook is not opening when launched from the Anaconda Navigator but opens fine when I type the command from the Windows command prompt. None of the applications displayed in the Anaconda Navigator open and remain stuck as seen in the screenshot attached. But these applications do open when executed independently from the Windows Start menu.
Hope you understand the issue and respond to what may be the issue that makes the Navigator work improperly. I have already reinstalled many times but the issue persists.
Not sure about the applications not launching, but you can try going to Environments in the navigator, then click launch (looks like a play button) and "Open with Jupyter Notebook". This one works for me.
P.s. choose the environment you are looking for. If you did not create any additional envs, choose 'base'.
I have downloaded the new IntelPython and installed the package according to the directions on the page.
So, after I installed the application, I followed these instructions for Windows:
Open a terminal or shell and then navigate to the installation
folder. This will normally be C:\IntelPython3. Navigate to the
Scripts folder, and run activate.
After the script activates the
root Python environment, Intel Distribution for Python is ready to
use.
All good so far, then when I activated the root environment I started installing packages with pip, keras, tensorflow etc.
Amongst the packages I installed spyder too.
The issue is that when I am on the environment root I can type python and I start python 3.6 normally where then I can import all the packages that I installed.
But, when in the command window (while I am in the root env) I type spyder nothing happens. Instead I get a message that
Spyder is not recognised as an internal command
If I type, within C:\IntelPython3, conda list then I can see spyder but as I said the command doesn't work. I tried to find the spyder.exe within the C:\IntelPython3\Scripts folder but there is not there.
Any suggestions? Thanks
Edit: I can start Jupyter Notebook too from Windows terminal, the only issue is Spyder which is weird.