obfsproxy doesn't work

Hello there,

I've FreeBSD installed on my laptop with latest updates :

FreeBSD hadi-pc.my.domain 11.0-RELEASE-p9 FreeBSD 11.0-RELEASE-p9 #0: Tue Apr 11 08:48:40 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

I'm using Tor+obfsproxy for surfacing web, but for some reason obfsproxy doesn't seems to work after recent updates:

[hadi@hadi-pc /usr/home/hadi]$ obfsproxy
Traceback (most recent call last):
  File "/usr/local/bin/obfsproxy", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3019, in <module>
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 655, in _build_master
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 963, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 849, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'argparse' distribution was not found and is required by obfsproxy

I searched for a solution on the web, but couldn't find clear solution. can anybody how to resolve this? Thanks.
Last edited by a moderator:
obfsproxy needs to make argparse dependency conditional.

--- setup.py.orig    2014-12-31 16:34:31.000000000 +0100
+++ setup.py    2017-07-01 12:13:23.655178000 +0200
@@ -31,12 +31,14 @@
     install_requires = [
-        'Twisted',
-        'argparse',
+        'Twisted_Core',
         'pyptlib >= 0.0.6',

+    if sys.version_info < (2, 7):
+        install_requires.append('argparse')
     extras_require = {
         'SOCKS': ["txsocksx"]

Please, file a new PR via bugzilla and report this issue adding the traceback snippet.
cpm@ and Anti_Evil

Thank you for your answers both of you.

Regarding your answer cpm@ I have to admit that what you wrote in your first answer is above my head. Is it code change meant to be compiled into the original code?

Anti_Evil have you gotten any feedback?
Not yet. The bug-fixes generally depends on how much the port maintain team (or person) is active. Well, we can wait for sometime if nothing happen I'll study port-source and propose my patch.
No, prepare the patch now and attach it to PR 223320. For two reasons:
  1. It's much more likely for the maintainer to take a look if there is a patch attached to it.
  2. If the maintainer doesn't respond in 2 weeks (a "maintainer timeout") we can then commit your fix without the maintainer's approval.