0

I'm new to python and have a little experience with VS, C# and WPF.

My question might seem similar to some asked questions, but I tried several of the suggested solutions (that worked for others), and yet it doesn't work for me.

I'm trying to build a simple WPF application that will send http requests. The solution structure is as follows:

Solution MyApp
   Project 1 <This is the startup project>
      GUImodul.py
      queryStringBuilder.py
      <This project uses IronPython env for the WPF support>
   Project 2
      QuerySender.py (includes two classes)
      <This project uses Python 3.4 env, only in this one I managed installing the "requests" package which I need for sending the query>

When I try to run this I get an error "No module named ndg.httpsclient.ssl_peer_verification", even though I only import from project 2 a class that doesn't contain any import from "requests" (it only creates an instance of the other class there that does have such import).

When I try to install ndg-httpsclient using pip, I get "Command python setup.py egg_info failed with error code 1".

Things I tried so far:

  1. Adding "-X:FullFrames" to the debug properties of both projects
  2. (re)installing steuptools with from ez_setup.zip
  3. As said - ndg-httpsclient is installed for Python34
  4. Using the "import requests" command only within the class NOT imported to Project1 (the one with IronPython env)
  5. Tried installing a newer(?) version of urllib3

So... I just might be doing something fundamentally wrong in this solution, which in this case I wish someone to help me understand what it is.

Otherwise, any idea what can I try next to make this thing work?

Jérémie Bertrand
  • 3,025
  • 3
  • 44
  • 53
DannyL
  • 505
  • 4
  • 10

1 Answers1

0

If you read the fine print, ndg-httpsclient is incompatible with Python 3, as it was developed for Python2.7 . That's probabably the root cause.

RE: Why is Python 3.0 not backward compatible?

Community
  • 1
  • 1
Refael Ackermann
  • 1,498
  • 1
  • 18
  • 24
  • Hmm... guess that's the major part of the problem. Interesting though is that within the console of Python 3.4 I do manage to get that piece of "requests"-dependant code running (including importing the pkg). – DannyL Jan 25 '15 at 19:05
  • I'm going to try this solution again with IronPython 2.7 or just Python 2.7. – DannyL Jan 25 '15 at 19:10
  • So... my project shifted a bit, so the use of WPF GUI became unnecessary. However, trying to use the "requests" packages' functions did work within the python 3.4 console, which was confusing and seemed a bit odd, but not impossible of course. Long story short, I: 1. Installed python 2.7 (now having python 2.7, 3.4 and IronPython 2.7) 2. Started a new solution with python 2.7 as the environment 3. Installed "requests" And finally it all works! – DannyL Feb 07 '15 at 16:36
  • Release 0.4.0 - Made dual compatible with Python 2 / 3. – ajsmith007 Aug 13 '15 at 21:18