These are chat archives for spyder-ide/public

12th
Nov 2018
Randy Eckman
@emanspeaks
Nov 12 2018 02:25
hello! I have a quick dev question if there are any Spyder developers online at the moment!
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 02:25
Sure! What's up?
Randy Eckman
@emanspeaks
Nov 12 2018 02:27
I am working on troubleshooting some LSP issues, and one of the problems I'm dealing with has to do with the fact that we are not passing the LSPClient constructor a path to use as the "rootUri"
I think what I need to do is set it to the current Spyder working directory, but I have no idea where that is in the grand scheme of things
How do I query for/where is this stored?
or here's probably the better question. I think what I want the behavior to be is use the project directory if a project is open. If no project is open, use the working directory
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 02:31
You should be able to get it from the spyder.utils.misc.getcwd_or_home() function
If a project is open, cwd should be set to the project dir automatically unless the user explicitly changes it (navigates up/down).
Randy Eckman
@emanspeaks
Nov 12 2018 02:34
if they have navigated away from the project dir, is there any other way to explicitly get the project dir?
the project explorer has to know what that path is presumably, and it doesn't follow cwd
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 02:34
Yes
Randy Eckman
@emanspeaks
Nov 12 2018 02:35
(my apologies if these are very basic questions, I am new to actually digging into the code!)
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 02:36
I'm no expert either, lol. We're really glad for the help, particularly on getting LSP working more reliably!
Randy Eckman
@emanspeaks
Nov 12 2018 02:37
yeah! once i made a lot of tweaks to things to get it working on my local install, it actually works quite well. So of course I had to rock the boat. I wanted to try adding in another LSP for a language besides Python, and that's where I'm running into these issues
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 02:38

@ccordoba12 do you know

if they have navigated away from the project dir, is there any other way to explicitly get the project dir?

off the top of your head?

Randy Eckman
@emanspeaks
Nov 12 2018 02:47
i did some more digging on my own. it looks like as long as you are inside something that is a derived class of PluginWidget, then self.main.projects.get_active_project_path() should work
since all PluginWidget-based objects have self.main as a reference to the main window
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 02:48
Looks like that should work.
Jitse Niesen
@jitseniesen
Nov 12 2018 07:36
@emanspeaks Yes, that's the one
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:02
Hello
I installed Anaconda on Windows 7. It installed successfully, but when I try to start Spyder, in doesn't launch.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:03
What version of Anaconda? What version of Python? How did you try to launch it? What specific behavior and/or error messages did you experience? Can you post a screenshot?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:03
It is supposed that is was installed together with Anaconda. I I tried the installation twice with same results.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:04
^
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:05
Spyder is actually there in the Anaconda navigator, but when I press the Launch button, it looks that it is going to start, but suddenly it stops and nothing happens.
Anaconda Navigator ver. 1.9.2
Spyder version 3.3.1
Python version 3.7.0
It is the latest Anaconda package from the Anaconda website
Windows 7 64 bits
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:10
When I press the Launch button on spyder, it looks that it is going to start, but it stops and that's it.
There are no messages
I thought probably you have received reports about the this problem before.
I can try with a previous version of Anaconda.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:12
No
I actually used to get that same behavior launching Spyder from Anaconda Navigator myself on one of my machines, but it eventually went away if I recall.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:12
ok, what do you recommend?
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:13
I think the problem is probably with Navigator. Try launching Spyder the normal way, via the shortcut.
(Press Windows key and start typing Spyder, in case you're unfamiliar)
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:14
I clicked in the spyder icon from start button-> all Programs, but nothing happens
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:14
Have you ever opened it successfully before on that machine?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:15
No. I did it on a Mac before without any issue.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:16
Okay, thanks. Open the Anaconda prompt and type spyder --new-instance
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:16
I tried also typing Spyder on the windos prompt with same result
*windows
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:17
"Same result" so you get no output whatsover? It shouldn't even work on the Windows command prompt unless you selected to add Anaconda to your $PATH$ during installation.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:17
Yes, I get no output
let me check the path
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:17
No, can you just try exactly what I asked above?
Open the Anaconda prompt and type spyder --new-instance
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:18
ok
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:18
Thanks
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:19
I did it, but nothing happens. It appears the sand clock and then nothing
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:20
Okay. Ctrl-C it, execute set SPYDER_DEBUG=3 and try again.
Also, does spyder --help give you help output?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:22
spyder --help
it gives the usage
nothing happens with the other
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:23
Screenshot?
Also, post the full output of where spyder and where python.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:24
ok, I am trying but I cannot paste the screenshot here
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:24
What browser?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:25
Chrome
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:25
There might be some issue with chrome where its not allowing pasting. Works fine in FF.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:25
Let me change to FF
I have to install it.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:26
Before you do all that
try dragging and dropping it
Or just use imgur or something
I'm not sure why so many people are having trouble with this but at some point I should log in with Chrome and test it.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:31
I am installing FIrefox
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:33
So none of those options worked? I'm all for supporting Firefox but it seems a little much to ask someone to install a whole other browser just to use a basic feature of Gitter. Did dragging and dropping not work? Did you make sure you copied it correctly?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:33
They didn't work
Yes, tried several times
I am finishing installing FF
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:34
I mean you could always use Imgur or any other such service and post the link. But if you want to install Firefox, go ahead ofc.
Okay, that isn't the first time we've seen this, although I'm baffled as to the exact reasons.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:36
I have the page in FF.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:37
Okay, does pasting work now?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:37
Let me open the chat there
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:37
Oh
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:37
I cannot see the chat button
In the blog right?
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:38
It should be anywhere
But that's a bug
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:39
Mm. Cannot find it
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:40
Hmm, I can't see it in my production copy of FF 63 with a bunch of security stuff, but I can see it just fine when the same FF is opened in a clean profile.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:41
That's strange. It doesn't appears here.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:41
Okay I can see it now, privacy badger was blocking it.
Odd
Okay
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:41
Ok.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:41
I'm in it right now
Yup, as I thought.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:42
Can you fix it?
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:44
Possibly, but it would take some work, and the workaround is easy (and will work in any browser. So the reason it doesn't work is due to being hosted on the Spyder website which apparently won't make it go through to Gitter, possibly due to CORS restrictions or something like that. The solution is to just open it in normal Gitter and paste it there.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:44
Ok.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:46
Thanks for helping narrow down the pasting issue. Not sure what is causing the chat to not appear at all since I cannot reproduce it in a clean copy of the same version of FF just on Win 8.1 x64 instead of 7.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:47
Ok
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:48
Can you paste the screenshot now?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:48
Let me try
No. It doesn't work.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:50
Chrome or FF?
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:50
Chrome. I cannot see the Open chat in FF
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:51
That doesn't matter for this since you need to go to the link I posted anyway, as screenshots don't seem to be working in the embedded Gittersidecar.
Enrique Izaguirre
@eniv230862
Nov 12 2018 21:52
Ok, let me try. I come back in a few minutes
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 21:52
Okay, thanks
If that doesn't work just upload it to Imgur and post the link
Sorry its been so difficult
Randy Eckman
@emanspeaks
Nov 12 2018 22:10
image.png
i am using chrome, and i just hit printscreen and then ctrl+v in the chat bar
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:12
Mm. For some reason It doesn't work here.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:12
Thanks @emanspeaks
Output of where spyder and where python?
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:16
where python:
D:\Users\212705056\AppData\Local\Continuum\anaconda3\python.exe
D:\Users\212705056\AppData\Local\Continuum\anaconda3\Scripts\spyder.exe
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:23
There's a chance it could be due to installing on another drive; Windows is weird like that. One thing you can try to get it to launch is in the Anaconda prompt, navigate to the anaconda3/Lib/site-packages/spyder directory and then run python app/start.py; if that doesn't work try python app/mainwindow.py and report the results. It could also be some security thing; try temporarily disabling any security or firewall software you may have. Finally, try launching another application like Jupyter QtConsole from the navigator or jupyter qtconsole on the command line and see if it launches.
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:26
Let me try that. By the way, QtConsole works without any issue.
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:37
None of them worked.
Nothing happens. It just seems like it is going to work, a few seconds afterwards the prompt comes back and nothing happens.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:38
You don't get any output at all? That's really baffling...
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:38
Any output
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:39
Try creating a new, fresh conda env and installing Spyder it in.
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:39
Ok.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:39
conda create -n spyder-test-env python=3.6
activate spyder-test-env
conda install spyder
spyder --new-instance
Also, if that still doesn't work, try conda install pyqt=5.6 pyopengl in that environment.
If that doesn't work I'd suspect some driver, security software, etc. installed somewhere on your machine to be interfering somehow.
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:42
It says: Solving environment failed
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:42
What error?
For which command exactly?
Please post a screenshot or full input/output
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:44
CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/free/win-64/repodata.json.bz2
Probably it has to do with the firewall here.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:46
On your machine or higher up on your network?
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:46
ON the network. I has many security filters
Even so, I'll continue trying. Thanks a lot for your help. If I find anything I let you know.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:47
Let your IT staff know, of course, so they can fix it; otherwise your Anaconda install is virtually unsuable without the ability to install, manage and update packages. Are you sure you disabled any security software locally?
If the above doesn't work, that's what I'd strongly suspect.
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:48
Yes,
anaconda installed well, and the other apps work well there. It is just spyder.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:50
There's not a ton more you can do if you can't even install packages, but there are some more things you can try in the Spyder Troubleshooting Guide, specifically the Basic First Aid and Emergency CPR sections. Also, try installing on your boot drive (C:/).
Enrique Izaguirre
@eniv230862
Nov 12 2018 22:51
Ok. I'll do it. Thanks a lot.
CAM Gerlach
@CAM-Gerlach
Nov 12 2018 22:54
Best of luck!