diff --git a/dvc/daemon.py b/dvc/daemon.py
index 185ec2a19..1d67a37b9 100644
--- a/dvc/daemon.py
+++ b/dvc/daemon.py
@@ -2,6 +2,7 @@
 
 import os
 import sys
+import inspect
 from subprocess import Popen
 
 import dvc.logger as logger
@@ -12,7 +13,7 @@ CREATE_NEW_PROCESS_GROUP = 0x00000200
 DETACHED_PROCESS = 0x00000008
 
 
-def _spawn_windows(cmd):
+def _spawn_windows(cmd, env):
     from subprocess import STARTUPINFO, STARTF_USESHOWWINDOW
 
     creationflags = CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS
@@ -21,14 +22,14 @@ def _spawn_windows(cmd):
     startupinfo.dwFlags |= STARTF_USESHOWWINDOW
 
     Popen(cmd,
-          env=fix_env(),
+          env=env,
           close_fds=True,
           shell=False,
           creationflags=creationflags,
           startupinfo=startupinfo).communicate()
 
 
-def _spawn_posix(cmd):
+def _spawn_posix(cmd, env):
     # NOTE: using os._exit instead of sys.exit, because dvc built
     # with PyInstaller has trouble with SystemExit exeption and throws
     # errors such as "[26338] Failed to execute script __main__"
@@ -55,7 +56,7 @@ def _spawn_posix(cmd):
     sys.stdout.close()
     sys.stderr.close()
 
-    Popen(cmd, env=fix_env(), close_fds=True, shell=False).communicate()
+    Popen(cmd, env=env, close_fds=True, shell=False).communicate()
 
     os._exit(0)  # pylint: disable=protected-access
 
@@ -71,12 +72,16 @@ def daemon(args):
         cmd += ['-m', 'dvc']
     cmd += ['daemon', '-q'] + args
 
-    logger.debug("Trying to spawn '{}'".format(cmd))
+    env = fix_env()
+    file_path = os.path.abspath(inspect.stack()[0][1])
+    env['PYTHONPATH'] = os.path.dirname(os.path.dirname(file_path))
+
+    logger.debug("Trying to spawn '{}' with env '{}'".format(cmd, env))
 
     if os.name == 'nt':
-        _spawn_windows(cmd)
+        _spawn_windows(cmd, env)
     elif os.name == 'posix':
-        _spawn_posix(cmd)
+        _spawn_posix(cmd, env)
     else:
         raise NotImplementedError
 

daemon: address dvc directly
Our daemon is using `sys.executable -m dvc` to launch a new dvc process, but a more proper way would be to address dvc directly, by dynamically computing its location ourselves from `__file__`. See discussion https://github.com/iterative/dvc/issues/1509#issuecomment-457415307 .
diff --git a/tests/unit/daemon.py b/tests/unit/daemon.py
new file mode 100644
index 000000000..3ab101978
--- /dev/null
+++ b/tests/unit/daemon.py
@@ -0,0 +1,31 @@
+import os
+import mock
+import inspect
+from unittest import TestCase
+
+import dvc.daemon as daemon
+
+
+class TestDaemon(TestCase):
+    @mock.patch('dvc.daemon._spawn_posix')
+    @mock.patch('dvc.daemon._spawn_windows')
+    def test(self, mock_windows, mock_posix):
+        daemon.daemon(['updater'])
+
+        if os.name == 'nt':
+            mock_posix.assert_not_called()
+            mock_windows.assert_called()
+            args, kwargs = mock_windows.call_args
+        else:
+            mock_windows.assert_not_called()
+            mock_posix.assert_called()
+            args, kwargs = mock_posix.call_args
+
+        env = args[1]
+        self.assertTrue('PYTHONPATH' in env.keys())
+
+        file_path = os.path.abspath(inspect.stack()[0][1])
+        file_dir = os.path.dirname(file_path)
+        test_dir = os.path.dirname(file_dir)
+        dvc_dir = os.path.dirname(test_dir)
+        self.assertEqual(env['PYTHONPATH'], dvc_dir)

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest>=3.3.1 nose>=1.3.7 mock>=2.0.0 coverage>=4.5.1 codecov>=2.0.15 xmltodict>=0.11.0 awscli>=1.14.18 google-compute-engine Pygments collective.checkdocs
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
altgraph==0.17.4
appdirs==1.4.4
asciimatics==1.14.0
attrs==22.2.0
awscli==1.24.10
azure-common==1.1.28
azure-nspkg==3.0.2
azure-storage-blob==1.3.0
azure-storage-common==1.3.0
azure-storage-nspkg==3.1.0
bcrypt==4.0.1
boto==2.49.0
boto3==1.7.4
botocore==1.10.84
cachetools==4.2.4
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
codecov==2.1.13
collective.checkdocs==0.2
colorama==0.4.4
configobj==5.0.8
configparser==5.2.0
coverage==6.2
cryptography==40.0.2
decorator==4.4.2
distro==1.9.0
docutils==0.16
-e git+https://github.com/iterative/dvc.git@fdb103ed666072d294f39317f15ece6be7c1701e#egg=dvc
future==1.0.0
gitdb==4.0.9
GitPython==3.1.18
google-api-core==1.32.0
google-auth==1.35.0
google-cloud-core==0.28.1
google-cloud-storage==1.13.0
google-compute-engine==2.8.13
google-crc32c==1.3.0
google-resumable-media==2.3.3
googleapis-common-protos==1.56.3
grandalf==0.6
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
jmespath==0.10.0
jsonpath-rw==1.4.0
macholib==1.16.3
mock==5.2.0
nanotime==0.5.2
networkx==2.5.1
nose==1.3.7
packaging==21.3
paramiko==3.5.1
pefile==2024.8.26
Pillow==8.4.0
pluggy==1.0.0
ply==3.11
protobuf==3.19.6
py==1.11.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
pydot==1.4.2
pyfiglet==0.8.post1
Pygments==2.14.0
PyInstaller==3.3.1
PyNaCl==1.5.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==5.4.1
requests==2.27.1
rsa==4.7.2
s3transfer==0.1.13
schema==0.7.7
six==1.17.0
smmap==5.0.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
wcwidth==0.2.13
xmltodict==0.14.2
zc.lockfile==2.0
zipp==3.6.0

name: dvc
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - altgraph==0.17.4
      - appdirs==1.4.4
      - asciimatics==1.14.0
      - attrs==22.2.0
      - awscli==1.24.10
      - azure-common==1.1.28
      - azure-nspkg==3.0.2
      - azure-storage-blob==1.3.0
      - azure-storage-common==1.3.0
      - azure-storage-nspkg==3.1.0
      - bcrypt==4.0.1
      - boto==2.49.0
      - boto3==1.7.4
      - botocore==1.10.84
      - cachetools==4.2.4
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - collective-checkdocs==0.2
      - colorama==0.4.4
      - configobj==5.0.8
      - configparser==5.2.0
      - coverage==6.2
      - cryptography==40.0.2
      - decorator==4.4.2
      - distro==1.9.0
      - docutils==0.16
      - future==1.0.0
      - gitdb==4.0.9
      - gitpython==3.1.18
      - google-api-core==1.32.0
      - google-auth==1.35.0
      - google-cloud-core==0.28.1
      - google-cloud-storage==1.13.0
      - google-compute-engine==2.8.13
      - google-crc32c==1.3.0
      - google-resumable-media==2.3.3
      - googleapis-common-protos==1.56.3
      - grandalf==0.6
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jmespath==0.10.0
      - jsonpath-rw==1.4.0
      - macholib==1.16.3
      - mock==5.2.0
      - nanotime==0.5.2
      - networkx==2.5.1
      - nose==1.3.7
      - packaging==21.3
      - paramiko==3.5.1
      - pefile==2024.8.26
      - pillow==8.4.0
      - pluggy==1.0.0
      - ply==3.11
      - protobuf==3.19.6
      - py==1.11.0
      - pyasn1==0.5.1
      - pyasn1-modules==0.3.0
      - pycparser==2.21
      - pydot==1.4.2
      - pyfiglet==0.8.post1
      - pygments==2.14.0
      - pyinstaller==3.3.1
      - pynacl==1.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==5.4.1
      - requests==2.27.1
      - rsa==4.7.2
      - s3transfer==0.1.13
      - schema==0.7.7
      - six==1.17.0
      - smmap==5.0.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - wcwidth==0.2.13
      - xmltodict==0.14.2
      - zc-lockfile==2.0
      - zipp==3.6.0
prefix: /opt/conda/envs/dvc

tests/unit/daemon.py::TestDaemon::test
dvc/daemon.py
dvc/daemon.py