![]() |
Problem running script within console - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Problem running script within console (/thread-25253.html) |
Problem running script within console - koepjo - Mar-24-2020 Hi there, I'm using Anaconda 3.x and Spyder 4.1.1. I'm trying to interpreted the script import numpy. This works while executed by Spyder. But python myPiy.pyfails with the error I tried to reinstall numpy, which I installed manually using conda install numpy to begin with.Using instead modules, which came with Anaconda, e. g. [apython]import time[\python], everything works fine. How can I make additional installed modules known to the Python interpreter? Thanks in advance for your reply, Johannes RE: Problem running script within console - deanhystad - Mar-25-2020 I had a similar problem and eventually determined I installed the package on python 3.8 but running a script as you are doing ran python 3.6. Another time I installed a package inside a virtual environment and couldn't see it when I ran my global environment. So easy to get that messed up. RE: Problem running script within console - koepjo - Mar-25-2020 (Mar-25-2020, 03:42 AM)deanhystad Wrote: I had a similar problem and eventually determined I installed the package on python 3.8 but running a script as you are doing ran python 3.6. Another time I installed a package inside a virtual environment and couldn't see it when I ran my global environment. So easy to get that messed up. Thanks’ a lot, choosing the correct environment actually is related to my problem. I don’t understand what I’m doing but I was able to solve a part of my problem by playing with the existing environments. Still my core issue remains. Could you please answer another question concerning this?
Thanks in advance, Regards, Johannes RE: Problem running script within console - koepjo - Mar-26-2020 (Mar-25-2020, 06:44 PM)koepjo Wrote:(Mar-25-2020, 03:42 AM)deanhystad Wrote: I had a similar problem and eventually determined I installed the package on python 3.8 but running a script as you are doing ran python 3.6. Another time I installed a package inside a virtual environment and couldn't see it when I ran my global environment. So easy to get that messed up. I was able to change the envionment by running activate.batin the environment's "Script" folder. Afterward I can execute my wcript with python.exe myScrript. Then the required modules are available, thank's again for the hint! But doing this in a bat script doesn't work. It's execution stops without any output after the activate script finished. What can I do? Thank's a lot in advance! |