# obfsproxy doesn't work



## Anti_Evil (Jul 1, 2017)

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>
    @_call_aside
  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
    ws.require(__requires__)
  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.


----------



## cpm@ (Jul 1, 2017)

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 = [
         'setuptools',
         'PyCrypto',
-        'Twisted',
-        'argparse',
+        'Twisted_Core',
         'pyptlib >= 0.0.6',
         'pyyaml'
         ],

+    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.


----------



## Monti (Oct 28, 2017)

Anti_Evil

Did you find a solution? I'm trying with the latest version 0.2.13_1,1 and get the same messages as you.


----------



## cpm@ (Oct 28, 2017)

Monti said:


> Anti_Evil
> 
> Did you find a solution? I'm trying with the latest version 0.2.13_1,1 and get the same messages as you.



See comment #2.


----------



## Anti_Evil (Oct 30, 2017)

Has already filed a PR for this issue


----------



## Monti (Oct 31, 2017)

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?


----------



## Monti (Oct 31, 2017)

Just adding a link for the security/obfsproxy bug report PR 223320


----------



## Anti_Evil (Nov 1, 2017)

Monti said:


> Just adding a link for the security/obfsproxy bug report PR 223320


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.


----------



## tobik@ (Nov 1, 2017)

Anti_Evil said:


> 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:

It's much more likely for the maintainer to take a look if there is a patch attached to it. 
If the maintainer doesn't respond in 2 weeks (a "maintainer timeout") we can then commit your fix without the maintainer's approval.


----------



## Monti (Nov 1, 2017)

Thanks for the info guys. Appreciate it.


----------

