Hi Philip, The problem of this thread is already solved. It also did not relate to the standalone version of Spyder.
Kind regards yfprojects [email protected] schrieb am Samstag, 22. Mai 2021 um 15:38:47 UTC: > The standalone Spyder 5.0.3 Windows installer includes its own Python > environment which is independent of Anaconda... It includes python, numpy, > matplotlib, pandas but does not include all the other additional data > science libraries such as sklearn. The default Python environment is custom > (Python 3.7.9) as shown at the bottom. > > [image: Untitled 20.jpg] > > More details about what is included is given in Help and then Dependencies > (note sklearn is not listed): > > [image: vlcsnap-2021-05-22-08h54m54s684.png] > > [image: vlcsnap-2021-05-22-08h54m59s988.png] > > To use sklearn and other data science libraries with the latest version of > Spyder 5 you need to create a conda environment. I recommend cloning the > base conda environment. To make the environment appropriate for Spyder 5 > you need to remove the old spyder-kernels (for Spyder 4) and install the > latest ones from conda forge (for Spyder 5). > > Open up the Anaconda Powershell Prompt and type in: > conda create --name spyder5env --clone base > conda activate spyder5env > conda remove spyder-kernels > conda install --channel conda-forge spyder-kernels > > Install any other packages (avoid pip where possible and instead > preferentially install from conda or conda forge). > > Type the following into the address bar in Windows Explorer using the > Windows 10 Environmental variable: > > %UserProfile%\anaconda3\envs\spyder5env > > This should take you to the new env folder where you can copy the address: > [image: vlcsnap-2021-05-22-09h05m55s490.png] > > > Launch Spyder 5 and select Tools and Preferences: > [image: vlcsnap-2021-05-22-08h56m03s302.png] > > Select Python Interpreter to the left hand side and then select Use the > following Python interpreter. Paste the copied path: > [image: vlcsnap-2021-05-22-09h06m42s702.png] > Add the \ behind the path name and the python.exe should auto-populate: > [image: vlcsnap-2021-05-22-09h06m50s549.png] > > Apply the changes and close and relaunch Spyder. Notice that it is now > using the custom conda environment called spyder5env and as this was made > from a clone of the base Anaconda installation it contains all the data > science libraries: > [image: Untitled 21.jpg] > > Note if you have Spyder4 installed (with Anaconda3) you will need to > change the Python interpreter back to the base environment as the newer > spyder-kernels are incompatible with the older version of Spyder. > > [image: vlcsnap-2021-05-22-11h07m13s148.png] > > [image: vlcsnap-2021-05-22-11h07m49s971.png] > [image: vlcsnap-2021-05-22-11h09m29s663.png] > I made a tutorial video doing this: > Installing the Spyder 5 IDE on Windows 10 and Modules within an Anaconda > (conda) Python Environment - YouTube > <https://www.youtube.com/watch?v=lWboCXJWiIE> > > On Friday, May 21, 2021 at 6:53:17 AM UTC+1 yfprojects wrote: > >> DeTermined, >> >> I am glad your problem is solved. >> >> Kind regards >> yfprojects >> >> DeTermined schrieb am Donnerstag, 20. Mai 2021 um 16:31:27 UTC: >> >>> yfprojects, >>> >>> I figured out what I did and how to fix it. >>> >>> First, I installed anaconda. From the anaconda browser I installed and >>> launched spyder. When I launched, I got a message that 5.0 was available. >>> I was excited to get the latest version. So I went to the main spyder page >>> got the latest and installed it. I merrily went along with my new spyder 5 >>> for a while, not noticing my mistake, until I tried to import scikit-learn. >>> >>> Fixing my mess was not too hard. In Windows I uninstalled spyder 5. >>> Then I went back to the anaconda prompt and installed it there, and I was >>> back in business. >>> >>> Thank you again - I would not have figured it out if you had not >>> suggested going to the anaconda environment! >>> >>> DeTermined >>> On Wednesday, May 19, 2021 at 11:01:56 PM UTC-7 yfprojects wrote: >>> >>>> Hi DeTermined, >>>> >>>> another person posted a similar issue here in the group >>>> <https://groups.google.com/g/spyderlib/c/F7mND9O1KDE>. I actually >>>> don't know what the problem is, but it seems to related to spyder. You >>>> could try to type in the import manually into the qtconsole which is the >>>> backend of spyders console. You can start it with `jupyter qtconsole` in >>>> the anaconda prompt. >>>> >>>> It would also be great if you opened a Issue for spyder's repository >>>> on github <https://github.com/spyder-ide/spyder/issues>. >>>> >>>> Kind regards >>>> yfprojects >>>> >>>> DeTermined schrieb am Mittwoch, 19. Mai 2021 um 17:39:25 UTC: >>>> >>>>> yfprojects, >>>>> >>>>> I think I understand where you are going. The anaconda prompt has a >>>>> sys.path that includes anaconda3\\lib\\site-packages, where the >>>>> scikit-learn package is. In spyder the sys.path does not include the >>>>> anaconda\\lib\\site-packages. In Sypder if I add the missing folders to >>>>> sys.path, spyder does get further. With the updated sys.path, the error >>>>> in >>>>> sypder is "ImportError: No module name >>>>> 'sklearn.__check_build._check_build'" >>>>> >>>>> Thanks for the response, >>>>> DeTermined >>>>> On Wednesday, May 19, 2021 at 9:03:01 AM UTC-7 DeTermined wrote: >>>>> >>>>>> On an anaconda command prompt, I get this: >>>>>> >>>>>> (base) C:\Users\daton>python -c "import sklearn; >>>>>> sklearn.show_versions()" >>>>>> >>>>>> System: >>>>>> python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit >>>>>> (AMD64)] >>>>>> executable: C:\Users\daton\anaconda3\python.exe >>>>>> machine: Windows-10-10.0.19041-SP0 >>>>>> >>>>>> Python dependencies: >>>>>> pip: 21.0.1 >>>>>> setuptools: 52.0.0.post20210125 >>>>>> sklearn: 0.24.1 >>>>>> numpy: 1.20.2 >>>>>> scipy: 1.6.2 >>>>>> Cython: 0.29.23 >>>>>> pandas: 1.2.4 >>>>>> matplotlib: 3.3.4 >>>>>> joblib: 1.0.1 >>>>>> threadpoolctl: 2.1.0 >>>>>> >>>>>> Built with OpenMP: True >>>>>> On Tuesday, May 18, 2021 at 11:19:41 PM UTC-7 yfprojects wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> does the following command work in the anaconda environment you >>>>>>> installed `scikit-learn` in? >>>>>>> >>>>>>> >>>>>>> - python -c "import sklearn; sklearn.show_versions()" >>>>>>> >>>>>>> Kind regards >>>>>>> yfprojects >>>>>>> >>>>>>> DeTermined schrieb am Dienstag, 18. Mai 2021 um 20:20:51 UTC: >>>>>>> >>>>>>>> I am trying to use scikit-learn within spyder. I am using spyder >>>>>>>> 5.0.3 and anaconda 4.10.1. I installed scikit-learn on an anaconda >>>>>>>> prompt >>>>>>>> with the following command: >>>>>>>> >>>>>>>> conda install -c intel scikit-learn >>>>>>>> >>>>>>>> I got this command from the scikit documentation. Anaconda shows >>>>>>>> that version 0.24.1 of scikit-learn is installed. >>>>>>>> >>>>>>>> In spyder the following command: >>>>>>>> >>>>>>>> from sklearn.preprocessing import MinMaxScaler >>>>>>>> >>>>>>>> gives me "No module named 'sklearn'". What is wrong? >>>>>>>> >>>>>>>> -- You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/cd408223-9d9b-421f-b893-66e44120aa3en%40googlegroups.com.
